@primereact/core 11.0.0-alpha.1 → 11.0.0-alpha.10

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/base/index.d.mts CHANGED
@@ -12,6 +12,6 @@ import * as React from 'react';
12
12
  declare const useBase: <IProps extends {
13
13
  id?: string;
14
14
  ref?: React.Ref<unknown>;
15
- }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string | undefined, options: useBaseOptions<IProps, DProps, Exposes>) => Instance<Pick<IProps & DProps, keyof DProps>, IProps, Record<PropertyKey, unknown>, Exposes>;
15
+ }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string | undefined, options: useBaseOptions<IProps, DProps, Exposes>) => Instance<Pick<DProps & IProps, keyof DProps>, IProps, Record<PropertyKey, unknown>, Exposes>;
16
16
 
17
17
  export { useBase };
package/base/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var S=Object.defineProperty,b=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var C=(t,o,e)=>o in t?S(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,c=(t,o)=>{for(var e in o||(o={}))K.call(o,e)&&C(t,e,o[e]);if(k)for(var e of k(o))T.call(o,e)&&C(t,e,o[e]);return t},R=(t,o)=>b(t,v(o));import{usePrimeReact as j}from"@primereact/core/config";import{combinedRefs as A}from"@primereact/core/utils";import{useAttrSelector as U,useId as _,useProps as h}from"@primereact/hooks";import{resolve as H}from"@primeuix/utils";import*as n from"react";var N=(t="UnknownBase",o)=>{var x,E,B;let e=j(),{inProps:s,defaultProps:l,setup:L}=o||{},d=_(s==null?void 0:s.id),I=U("pc_"),a=n.useRef((x=s==null?void 0:s.ref)!=null?x:null),i=n.useRef(null),f=n.useMemo(()=>({ref:a,elementRef:i,id:d,name:t,inProps:s,$attrSelector:I,$primereact:e}),[d,s,I,e]),O=n.useMemo(()=>{var M,g,w,D;let p=H(((g=(M=e==null?void 0:e.config)==null?void 0:M.defaults)==null?void 0:g[t])||((D=(w=e==null?void 0:e.config)==null?void 0:w.defaults)==null?void 0:D[t.toLowerCase()]),f);return c(c({},l),p==null?void 0:p.props)},[l,(B=(E=e==null?void 0:e.config)==null?void 0:E.defaults)==null?void 0:B[t]]),{props:y,attrs:P}=h(s,O),u=n.useMemo(()=>R(c({},f),{props:y,attrs:P}),[f,y,P]),r=H(L,u),m=n.useMemo(()=>{var p;return R(c(c({state:{},$computedSetup:r},r),u),{elementRef:(p=r==null?void 0:r.elementRef)!=null?p:i})},[r,u]);return n.useEffect(()=>{A(a,s==null?void 0:s.ref)},[a,s==null?void 0:s.ref]),n.useImperativeHandle(a,()=>m,[m]),m};export{N as useBase};
1
+ var v=Object.defineProperty,T=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var b=(t,o,e)=>o in t?v(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,c=(t,o)=>{for(var e in o||(o={}))A.call(o,e)&&b(t,e,o[e]);if(D)for(var e of D(o))U.call(o,e)&&b(t,e,o[e]);return t},m=(t,o)=>T(t,j(o));import{usePrimeReact as _}from"@primereact/core/config";import{combinedRefs as k}from"@primereact/core/utils";import{useAttrSelector as h,useId as q,useProps as z}from"@primereact/hooks";import{resolve as L,toKebabCase as F}from"@primeuix/utils";import*as n from"react";var W=(t="UnknownBase",o)=>{var E,P,B;let e=_(),{inProps:s,defaultProps:l,setup:H}=o||{},d=q(s==null?void 0:s.id),I=h("pc_"),[K,O]=n.useMemo(()=>t.toLowerCase().split("."),[t]),a=n.useRef((E=s==null?void 0:s.ref)!=null?E:null),i=n.useRef(null),f=n.useMemo(()=>({ref:a,elementRef:i,id:d,name:t,scope:K,part:F(O),inProps:s,$attrSelector:I,$primereact:e}),[d,s,I,e,t]),S=n.useMemo(()=>{var M,w,g,C;let p=L(((w=(M=e==null?void 0:e.config)==null?void 0:M.defaults)==null?void 0:w[t])||((C=(g=e==null?void 0:e.config)==null?void 0:g.defaults)==null?void 0:C[t.toLowerCase()]),f);return c(c({},l),p==null?void 0:p.props)},[l,(B=(P=e==null?void 0:e.config)==null?void 0:P.defaults)==null?void 0:B[t]]),{props:y,attrs:x}=z(S,s),u=n.useMemo(()=>m(c({},f),{props:y,attrs:x}),[f,y,x]),r=L(H,u),R=n.useMemo(()=>{var p;return m(c(c({state:{},$computedSetup:r},r),u),{elementRef:(p=r==null?void 0:r.elementRef)!=null?p:i})},[r,u]);return n.useEffect(()=>{k(a,s==null?void 0:s.ref)},[a,s==null?void 0:s.ref]),k(a,s==null?void 0:s.ref),n.useImperativeHandle(a,()=>R,[R]),R};export{W as useBase};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/base/useBase.ts"],"sourcesContent":["import { usePrimeReact } from '@primereact/core/config';\nimport { combinedRefs } from '@primereact/core/utils';\nimport { useAttrSelector, useId, useProps } from '@primereact/hooks';\nimport type { BaseInstance, BaseSetup, CommonInstance, Instance, useBaseOptions } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for creating a base instance.\n * This hook is used to initialize a base instance with common properties and methods.\n * It handles props, attributes, and provides a setup function for additional configuration.\n * @param name The name of the base instance.\n * @param options The options for the base instance.\n * @returns The base instance.\n */\nexport const useBase = <IProps extends { id?: string; ref?: React.Ref<unknown> }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string = 'UnknownBase', options: useBaseOptions<IProps, DProps, Exposes>) => {\n const $primereact = usePrimeReact();\n const { inProps, defaultProps, setup } = options || {};\n\n const id = useId(inProps?.id as string | undefined);\n const $attrSelector = useAttrSelector('pc_');\n\n const ref = React.useRef(inProps?.ref ?? null);\n const elementRef = React.useRef<HTMLElement | null>(null);\n\n const base = React.useMemo<BaseInstance<IProps>>(\n () => ({\n ref,\n elementRef,\n id,\n name,\n inProps,\n $attrSelector,\n $primereact\n }),\n [id, inProps, $attrSelector, $primereact]\n );\n\n const computedDefaultProps = React.useMemo<DProps>(() => {\n const globalDefaults = resolve($primereact?.config?.defaults?.[name] || $primereact?.config?.defaults?.[name.toLowerCase()], base) as { props?: DProps } | undefined;\n\n return { ...defaultProps, ...globalDefaults?.props } as DProps;\n }, [defaultProps, $primereact?.config?.defaults?.[name]]);\n\n const { props, attrs } = useProps(inProps, computedDefaultProps);\n\n const common = React.useMemo<CommonInstance<typeof props, IProps>>(\n () => ({\n ...base,\n props,\n attrs\n }),\n [base, props, attrs]\n );\n\n const $computedSetup = resolve(setup as BaseSetup<typeof props, IProps, Exposes>, common) as Exposes;\n\n const instance = React.useMemo<Instance<typeof props, IProps, Record<PropertyKey, unknown>, Exposes>>(\n () => ({\n state: {},\n $computedSetup,\n ...$computedSetup,\n ...common,\n elementRef: ($computedSetup?.elementRef ?? elementRef) as React.RefObject<HTMLElement | null>\n }),\n [$computedSetup, common]\n );\n\n React.useEffect(() => {\n combinedRefs(ref, inProps?.ref);\n }, [ref, inProps?.ref]);\n\n React.useImperativeHandle(ref as React.Ref<Instance<typeof props, IProps, typeof instance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n};\n"],"mappings":"6aAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,mBAAAC,EAAiB,SAAAC,EAAO,YAAAC,MAAgB,oBAEjD,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QAUhB,IAAMC,EAAU,CAAiHC,EAAe,cAAeC,IAAqD,CAf3N,IAAAC,EAAAC,EAAAC,EAgBI,IAAMC,EAAcC,EAAc,EAC5B,CAAE,QAAAC,EAAS,aAAAC,EAAc,MAAAC,CAAM,EAAIR,GAAW,CAAC,EAE/CS,EAAKC,EAAMJ,GAAA,YAAAA,EAAS,EAAwB,EAC5CK,E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,GAAA,YAAAA,EAAS,GAAG,CAClC,EAAG,CAACO,EAAKP,GAAA,YAAAA,EAAS,GAAG,CAAC,EAEhB,sBAAoBO,EAAkF,IAAMc,EAAU,CAACA,CAAQ,CAAC,EAE/HA,CACX","names":["usePrimeReact","combinedRefs","useAttrSelector","useId","useProps","resolve","React","useBase","name","options","_a","_b","_c","$primereact","usePrimeReact","inProps","defaultProps","setup","id","useId","$attrSelector","useAttrSelector","ref","elementRef","base","computedDefaultProps","_d","globalDefaults","resolve","__spreadValues","props","attrs","useProps","common","__spreadProps","$computedSetup","instance","combinedRefs"]}
1
+ {"version":3,"sources":["../../src/base/useBase.ts"],"sourcesContent":["import { usePrimeReact } from '@primereact/core/config';\nimport { combinedRefs } from '@primereact/core/utils';\nimport { useAttrSelector, useId, useProps } from '@primereact/hooks';\nimport type { BaseInstance, BaseSetup, CommonInstance, Instance, useBaseOptions } from '@primereact/types/core';\nimport { resolve, toKebabCase } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for creating a base instance.\n * This hook is used to initialize a base instance with common properties and methods.\n * It handles props, attributes, and provides a setup function for additional configuration.\n * @param name The name of the base instance.\n * @param options The options for the base instance.\n * @returns The base instance.\n */\nexport const useBase = <IProps extends { id?: string; ref?: React.Ref<unknown> }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string = 'UnknownBase', options: useBaseOptions<IProps, DProps, Exposes>) => {\n const $primereact = usePrimeReact();\n const { inProps, defaultProps, setup } = options || {};\n\n const id = useId(inProps?.id as string | undefined);\n const $attrSelector = useAttrSelector('pc_');\n const [scope, part] = React.useMemo(() => name.toLowerCase().split('.'), [name]);\n\n const ref = React.useRef(inProps?.ref ?? null);\n const elementRef = React.useRef<HTMLElement | null>(null);\n\n const base = React.useMemo<BaseInstance<IProps>>(() => {\n return {\n ref,\n elementRef,\n id,\n name,\n scope,\n part: toKebabCase(part),\n inProps,\n $attrSelector,\n $primereact\n };\n }, [id, inProps, $attrSelector, $primereact, name]);\n\n const computedDefaultProps = React.useMemo<DProps>(() => {\n const globalDefaults = resolve($primereact?.config?.defaults?.[name] || $primereact?.config?.defaults?.[name.toLowerCase()], base) as { props?: DProps } | undefined;\n\n return { ...defaultProps, ...globalDefaults?.props } as DProps;\n }, [defaultProps, $primereact?.config?.defaults?.[name]]);\n\n const { props, attrs } = useProps(computedDefaultProps, inProps);\n\n const common = React.useMemo<CommonInstance<typeof props, IProps>>(\n () => ({\n ...base,\n props,\n attrs\n }),\n [base, props, attrs]\n );\n\n const $computedSetup = resolve(setup as BaseSetup<typeof props, IProps, Exposes>, common) as Exposes;\n\n const instance = React.useMemo<Instance<typeof props, IProps, Record<PropertyKey, unknown>, Exposes>>(\n () => ({\n state: {},\n $computedSetup,\n ...$computedSetup,\n ...common,\n elementRef: ($computedSetup?.elementRef ?? elementRef) as React.RefObject<HTMLElement | null>\n }),\n [$computedSetup, common]\n );\n\n React.useEffect(() => {\n combinedRefs(ref, inProps?.ref);\n }, [ref, inProps?.ref]);\n\n combinedRefs(ref, inProps?.ref);\n\n React.useImperativeHandle(ref as React.Ref<Instance<typeof props, IProps, typeof instance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n};\n"],"mappings":"6aAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,mBAAAC,EAAiB,SAAAC,EAAO,YAAAC,MAAgB,oBAEjD,OAAS,WAAAC,EAAS,eAAAC,MAAmB,kBACrC,UAAYC,MAAW,QAUhB,IAAMC,EAAU,CAAiHC,EAAe,cAAeC,IAAqD,CAf3N,IAAAC,EAAAC,EAAAC,EAgBI,IAAMC,EAAcC,EAAc,EAC5B,CAAE,QAAAC,EAAS,aAAAC,EAAc,MAAAC,CAAM,EAAIR,GAAW,CAAC,EAE/CS,EAAKC,EAAMJ,GAAA,YAAAA,EAAS,EAAwB,EAC5CK,EAAgBC,EAAgB,KAAK,EACrC,CAACC,EAAOC,CAAI,EAAU,UAAQ,IAAMf,EAAK,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be,CAC/C,IACA,CAACa,EAAgBF,CAAM,CAC3B,EAEA,OAAM,YAAU,IAAM,CAClBI,EAAahB,EAAKT,GAAA,YAAAA,EAAS,GAAG,CAClC,EAAG,CAACS,EAAKT,GAAA,YAAAA,EAAS,GAAG,CAAC,EAEtByB,EAAahB,EAAKT,GAAA,YAAAA,EAAS,GAAG,EAExB,sBAAoBS,EAAkF,IAAMe,EAAU,CAACA,CAAQ,CAAC,EAE/HA,CACX","names":["usePrimeReact","combinedRefs","useAttrSelector","useId","useProps","resolve","toKebabCase","React","useBase","name","options","_a","_b","_c","$primereact","usePrimeReact","inProps","defaultProps","setup","id","useId","$attrSelector","useAttrSelector","scope","part","ref","elementRef","base","toKebabCase","computedDefaultProps","_d","globalDefaults","resolve","__spreadValues","props","attrs","useProps","common","__spreadProps","$computedSetup","instance","combinedRefs"]}
@@ -28,10 +28,7 @@ declare const defaultComponentProps: ComponentProps;
28
28
  * @param options The options to customize the component instance.
29
29
  * @returns The component instance.
30
30
  */
31
- declare function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name?: string, options?: useComponentOptions<IProps, DProps, Exposes, Styles>): InComponentInstance<_primereact_types_index.SafeRecord<Pick<IProps & {
32
- id?: string;
33
- ref?: React.Ref<unknown>;
34
- } & {
31
+ declare function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name?: string, options?: useComponentOptions<IProps, DProps, Exposes, Styles>): InComponentInstance<_primereact_types_index.SafeRecord<Pick<{
35
32
  ref?: React.Ref<unknown> | undefined;
36
33
  pIf?: boolean | undefined;
37
34
  style?: React.CSSProperties | ((instance?: _primereact_types_core.ComponentInstance<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>, Record<PropertyKey, unknown>> | undefined) => React.CSSProperties | undefined) | undefined;
@@ -44,7 +41,10 @@ declare function useComponent<IProps, DProps, Exposes extends Record<PropertyKey
44
41
  dt?: unknown;
45
42
  styles?: _primereact_types_styles.StylesOptions | undefined;
46
43
  children?: React.ReactNode | ((instance: _primereact_types_core.ComponentInstance<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>, Record<PropertyKey, unknown>>) => React.ReactNode);
47
- }, "dt" | "style" | "ref" | "pIf" | "className" | "as" | "asChild" | "pt" | "ptOptions" | "unstyled" | "styles" | "children">>, IProps, Record<PropertyKey, unknown>, Exposes>;
44
+ } & IProps & {
45
+ id?: string;
46
+ ref?: React.Ref<unknown>;
47
+ }, "style" | "dt" | "ref" | "pIf" | "className" | "as" | "asChild" | "pt" | "ptOptions" | "unstyled" | "styles" | "children">>, IProps, Record<PropertyKey, unknown>, Exposes>;
48
48
 
49
49
  /**
50
50
  * A higher-order component for enhancing a component with additional features.
@@ -1,2 +1,2 @@
1
- var Ce=Object.defineProperty,Pe=Object.defineProperties;var Se=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var ce=(p,i,u)=>i in p?Ce(p,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):p[i]=u,s=(p,i)=>{for(var u in i||(i={}))pe.call(i,u)&&ce(p,u,i[u]);if(J)for(var u of J(i))ie.call(i,u)&&ce(p,u,i[u]);return p},I=(p,i)=>Pe(p,Se(i));var $=(p,i)=>{var u={};for(var r in p)pe.call(p,r)&&i.indexOf(r)<0&&(u[r]=p[r]);if(p!=null&&J)for(var r of J(p))i.indexOf(r)<0&&ie.call(p,r)&&(u[r]=p[r]);return u};import{isValidElement as he}from"@primereact/core/utils";import{cn as be,resolve as Q}from"@primeuix/utils";import*as U from"react";function we(p={}){var d,h,T,k;let B=p,{pIf:i=!0,style:u,className:r,as:a,asChild:R,instance:n}=B,e=$(B,["pIf","style","className","as","asChild","instance"]);if(i===!1)return null;let m=a||((d=n==null?void 0:n.props)==null?void 0:d.as)||U.Fragment,l=R||((h=n==null?void 0:n.props)==null?void 0:h.asChild),P=m===U.Fragment,w=e,{ref:C=n==null?void 0:n.elementRef,children:f,attrs:O}=w,M=$(w,["ref","children","attrs"]),N=s(s({},O),M),j=Q(f,n,N),D=Q(u||((T=n==null?void 0:n.props)==null?void 0:T.style),n),A=Q(r||((k=n==null?void 0:n.props)==null?void 0:k.className),n);return l||P?U.createElement(U.Fragment,null,j):he(m)?Q(m,n):U.createElement(m,I(s({},N),{ref:C,style:s(s({},N.style),D),className:be(N.className,A)}),j)}we.displayName="PrimeReact.Component";import{omit as ke}from"@primeuix/utils";var ee={ref:void 0,pIf:!0,style:void 0,className:void 0,as:void 0,asChild:!1,pt:void 0,ptOptions:void 0,unstyled:void 0,dt:void 0,children:void 0},He=I(s({},ke(ee,"pt","ptOptions","dt","styles")),{instance:void 0,attrs:void 0});import{useBase as je}from"@primereact/core/base";import*as W from"react";import{useMountEffect as Te,useUnmountEffect as Ie,useUpdateEffect as xe}from"@primereact/hooks";import{mergeProps as ne}from"@primeuix/utils/mergeprops";import{getKeyValue as X,isArray as Oe,isFunction as _e,isNotEmpty as Ee,isString as te,resolve as ue,toFlatCase as q}from"@primeuix/utils/object";import*as g from"react";function me(p,i){var L,G,z;let{id:u,name:r,props:a,attrs:R,$primereact:n,$attrSelector:e}=p||{},m=g.useCallback(t=>{let o=M(O(a.pt,r),X,`hooks.${t}`),c=h(X,`hooks.${t}`);o==null||o(),c==null||c()},[a.pt,r]),l=g.useCallback((t,...o)=>_e(t)?t(...o):t?ne(...o):Object.assign({},...o),[]),P=g.useCallback((t={},o="",c={},y=!0)=>{var ae;let b=/./g.test(o)&&!!c[o.split(".")[0]],{mergeSections:F=!0,mergeProps:S=!1}=(a==null?void 0:a.ptOptions)||((ae=n.config)==null?void 0:ae.ptOptions)||{},K=y?b?d(f,o,c):h(f,o,c):void 0,_=b?void 0:B(t,f,o,I(s({},c),{global:K||{}})),E=C(o);return F||!F&&_?l(S,K,_,E):s(s({},_),E)},[a.ptOptions,l]),C=g.useCallback((t="")=>{var y,b;let o="data-pc-",c=t==="root"&&Ee((y=a==null?void 0:a.pt)==null?void 0:y["data-pc-section"]);return t!=="transition"&&I(s({},t==="root"&&I(s({[`${o}name`]:q(c?(b=a.pt)==null?void 0:b["data-pc-section"]:r)},c&&{[`${o}extend`]:q(r)}),{[`${e}`]:""})),{[`${o}section`]:q(t)})},[a.pt,e]),f=g.useCallback((t={},o="",c)=>{let y=X(t,o,c);return te(y)||Oe(y)?{className:y}:y},[]),O=g.useCallback((t,o="",c)=>{let y=(b,F=!1)=>{var E;let S=c?c(b):b,K=q(o),_=q(r);return(E=F?K!==_?S==null?void 0:S[K]:void 0:S==null?void 0:S[K])!=null?E:S};return t&&Object.hasOwn(t,"_usept")?{_usept:t._usept,originalValue:y(t.originalValue),value:y(t.value)}:y(t,!0)},[]),M=g.useCallback((t,o,c="",y)=>{var F;let b=S=>o(S,c,y);if(t&&Object.hasOwn(t,"_usept")){let{mergeSections:S=!0,mergeProps:K=!1}=t._usept||((F=n.config)==null?void 0:F.ptOptions)||{},_=b(t.originalValue),E=b(t.value);return _===void 0&&E===void 0?void 0:te(E)?E:te(_)?_:S||!S&&E?l(K,_,E):E}return b(t)},[(L=n.config)==null?void 0:L.ptOptions,l]),N=g.useMemo(()=>{var t;return O((t=n==null?void 0:n.config)==null?void 0:t.pt,void 0,o=>ue(o,p))},[(G=n==null?void 0:n.config)==null?void 0:G.pt]),j=g.useMemo(()=>{var t;return O((t=n==null?void 0:n.config)==null?void 0:t.pt,void 0,o=>X(o,r,p)||ue(o,p))},[(z=n==null?void 0:n.config)==null?void 0:z.pt]),D=g.useMemo(()=>Object.entries(R||{}).filter(([t])=>t==null?void 0:t.startsWith("pt-")).reduce((t,[o,c])=>{let[,y,...b]=o.split("-");return[y,b==null?void 0:b.join("-")].reduce((F,S,K,_)=>(F[S]||(F[S]=K===_.length-1?c:{}),F[S]),t),t},{}),[R]),A=g.useMemo(()=>Object.entries(R||{}).filter(([t])=>!(t!=null&&t.startsWith("pt-"))).reduce((t,[o,c])=>(t[o]=c,t),{}),[R]),B=g.useCallback((t={},o,c="",y)=>ne(M(O(t,r),o,c,y),M(D,o,c,y)),[D]),d=g.useCallback((t,o="",c)=>M(N,t,o,c),[N]),h=g.useCallback((t,o,c)=>M(j,t,o,c),[j]),w=g.useCallback((t="",o={})=>P(a.pt,t,s(s({},i),o)),[a.pt,i]),T=g.useCallback((t="",o={})=>{var y;let c=ne(A,w(t,o));return c&&Object.hasOwn(c,"id")&&((y=c.id)!=null||(c.id=u)),c},[w,u,A]),k=g.useCallback((t={},o="",c={})=>P(t,o,s(s({},i),c),!1),[i]);return Te(()=>m("onMounted")),xe(()=>m("onUpdated")),Ie(()=>m("onUnmounted")),g.useMemo(()=>({ptm:w,ptmi:T,ptmo:k}),[w,T,k])}import{StyleRegistry as Y}from"@primereact/core/utils";import{Theme as H,ThemeService as Ke}from"@primeuix/styled";import{cn as ve,getKeyValue as re}from"@primeuix/utils";import*as x from"react";import{ThemeContext as Me}from"@primereact/core/theme";import{useStyle as Ne}from"@primereact/core/use-style";import{css as oe,dt as le,Theme as v}from"@primeuix/styled";import{isNotEmpty as Fe,minifyCSS as se,resolve as de,toElement as Le}from"@primeuix/utils";import*as V from"react";function fe(p,i){let u=V.useContext(Me),[r]=Ne(),a=V.useCallback((R,n)=>r({name:n==null?void 0:n.name,css:R,element:Le(i),options:n}),[r,i]);return V.useMemo(()=>{let R=I(s({name:"base"},p),{load(n="",e={},m="",l=!1){let P=e.name||R.name,C=oe`${n}${m}`,f=l?v.transformCSS(P,C):C;return Fe(f)?a(se(f),s({name:P},e)):{}},loadCSS(n){return this.load(this.css,n)},loadStyle(n,e=""){return this.load(this.style,n,e,!0)},getCommonTheme(n){return v.getCommon(this.name,n)},getComponentTheme(n){return v.getComponent(this.name,n)},getPresetTheme(n,e,m){return v.getCustomPreset(this.name,n,e,m)},getLayerOrderThemeCSS(){return v.getLayerOrderCSS(this.name)},getStyleSheet(n="",e={}){if(this.css){let m=de(this.css,{dt:le}),l=se(oe`${m}${n}`),P=Object.entries(e).reduce((C,[f,O])=>(C.push(`${f}="${O}"`),C),[]).join(" ");return`<style type="text/css" data-primereact-style-id="${this.name}" ${P}>${l}</style>`}return""},getCommonThemeStyleSheet(n,e={}){return v.getCommonStyleSheet(this.name,n,e)},getThemeStyleSheet(n,e={}){let m=[v.getStyleSheet(this.name,n,e)];if(u){let l=this.name==="base"?"global-style":`${this.name}-style`,P=oe`${de(u,{dt:le})}`,C=se(v.transformCSS(this.name,P)),f=Object.entries(e).reduce((O,[M,N])=>(O.push(`${M}="${N}"`),O),[]).join(" ");m.push(`<style type="text/css" data-primereact-style-id="${l}" ${f}>${C}</style>`)}return m.join("")}});return R},[p,u,a])}function ye(p,i,u){var B;let{props:r={unstyled:!1,dt:void 0},$primereact:a,$attrSelector:R,elementRef:n}=p||{},e=fe(i,n),m=x.useRef(null),l=x.useCallback(()=>{if(!Y.isStyleNameLoaded("base")){let{css:d}=e.baseStyles||{};e.load(d,s({name:"base"},f)),Y.setLoadedStyleName("base")}M()},[e]),P=x.useCallback(()=>{l(),j(l)},[l]),C=x.useMemo(()=>{var d;return r.unstyled!==void 0?r.unstyled:(d=a==null?void 0:a.config)==null?void 0:d.unstyled},[r,a==null?void 0:a.config]),f=x.useMemo(()=>{var d,h;return{nonce:(h=(d=a==null?void 0:a.config)==null?void 0:d.csp)==null?void 0:h.nonce}},[a==null?void 0:a.config]),O=x.useCallback(()=>{if(!Y.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let d=e.name==="global"?"base":e.name;e.loadCSS(s({name:d},f)),Y.setLoadedStyleName(e.name)}},[e,f]),M=x.useCallback(()=>{var d,h,w,T;if(!(C||(a==null?void 0:a.theme)==="none")){if(!H.isStyleNameLoaded("common")){let{primitive:k,semantic:L,global:G,style:z}=((d=e==null?void 0:e.getCommonTheme)==null?void 0:d.call(e))||{};e.load(k==null?void 0:k.css,s({name:"primitive-variables"},f)),e.load(L==null?void 0:L.css,s({name:"semantic-variables"},f)),e.load(G==null?void 0:G.css,s({name:"global-variables"},f)),e.load((h=e.baseStyles)==null?void 0:h.style,s({name:"global-style"},f),z,!0),H.setLoadedStyleName("common")}if(!H.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let{css:k,style:L}=((w=e==null?void 0:e.getComponentTheme)==null?void 0:w.call(e))||{};e.load(k,s({name:`${e.name}-variables`},f)),e.loadStyle(s({name:`${e.name}-style`},f),L),H.setLoadedStyleName(e.name)}if(!H.isStyleNameLoaded("layer-order")){let k=(T=e==null?void 0:e.getLayerOrderThemeCSS)==null?void 0:T.call(e);e.load(k,s({name:"layer-order",first:!0},f)),H.setLoadedStyleName("layer-order")}}},[C,e,f]),N=d=>{var T;let{css:h}=((T=e==null?void 0:e.getPresetTheme)==null?void 0:T.call(e,d,`[${R}]`))||{},w=e==null?void 0:e.load(h,s({name:`${R}-${e.name}`},f));m.current=w},j=x.useCallback((d=()=>{})=>{Ke.on("theme:change",d)},[]),D=x.useCallback((d="",h={})=>C?void 0:ve(re(e.classes,d,I(s({},u),{context:h}))),[C,p,e.classes]),A=x.useCallback((d="",h=!0,w={})=>{var T;if(h){let k=re(e.inlineStyles,d,I(s({},u),{context:w})),L=re((T=e.baseStyles)==null?void 0:T.inlineStyles,d,I(s({},u),{context:w}));return s(s({},L),k)}},[e.inlineStyles,(B=e.baseStyles)==null?void 0:B.inlineStyles,p]);return C||(O(),P(),N(r.dt)),x.useMemo(()=>({cx:D,sx:A,isUnstyled:C,$style:e}),[D,A,C,e])}function Re(p="UnknownComponent",i={}){let u=W.useMemo(()=>s(s({},ee),i.defaultProps),[i.defaultProps]),r=je(p,{inProps:i.inProps,defaultProps:u,setup:i.setup}),{ref:a,props:R}=r,n=W.useMemo(()=>({instance:r,props:r.props,attrs:r.attrs,state:r.state}),[r.props,r.attrs,r.state]),e=me(r,n),m=ye(r,R.styles||i.styles,n),l=W.useMemo(()=>s(s(s({},r),e),m),[r,e,m]);return W.useImperativeHandle(a,()=>l,[l]),l}import{isObject as ge}from"@primeuix/utils";import*as Z from"react";function Pn({name:p="UnknownComponent",defaultProps:i,styles:u,components:r,setup:a,render:R}){let e=Z.memo(m=>{let l=Re(p,{inProps:m,defaultProps:i,styles:u,setup:a}),P=R!=null?R:()=>null;return l.props.pIf?Z.createElement(P,s({},l)):null},(m,l)=>!ge(m)||!ge(l)?!1:m===l&&Object.keys(i||{}).every(P=>m[P]===l[P]));return e.displayName=`PrimeReact.${p}`,Object.entries(r||{}).forEach(([m,l])=>{e[m]=l}),e}export{we as Component,He as defaultComponentProps,ee as globalProps,Re as useComponent,Pn as withComponent};
1
+ var Se=Object.defineProperty,he=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var ue=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var pe=(c,u,l)=>u in c?Se(c,u,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[u]=l,s=(c,u)=>{for(var l in u||(u={}))ue.call(u,l)&&pe(c,l,u[l]);if(z)for(var l of z(u))le.call(u,l)&&pe(c,l,u[l]);return c},w=(c,u)=>he(c,be(u));var Z=(c,u)=>{var l={};for(var a in c)ue.call(c,a)&&u.indexOf(a)<0&&(l[a]=c[a]);if(c!=null&&z)for(var a of z(c))u.indexOf(a)<0&&le.call(c,a)&&(l[a]=c[a]);return l};import{isValidElement as we}from"@primereact/core/utils";import{cn as ke,resolve as J}from"@primeuix/utils";import*as A from"react";function Te(c={}){var i,b,T,S,x;let D=c,{pIf:u=!0,style:l,className:a,as:m,asChild:P,instance:n}=D,e=Z(D,["pIf","style","className","as","asChild","instance"]);if(u===!1)return null;let r=m||((i=n==null?void 0:n.props)==null?void 0:i.as)||A.Fragment,d=P||((b=n==null?void 0:n.props)==null?void 0:b.asChild),h=r===A.Fragment,_=e,{ref:y=n==null?void 0:n.elementRef,children:f,attrs:N}=_,j=Z(_,["ref","children","attrs"]),k=s(s({},N),j),v=J(f,n,k),H=J(l||((T=n==null?void 0:n.props)==null?void 0:T.style),n),U=J(a||((S=n==null?void 0:n.props)==null?void 0:S.className),n);if(d||h)return A.createElement(A.Fragment,null,v);if(we(r))return J(r,n);{let F=w(s({},k),{style:s(s({},k.style),H),className:ke(k.className,U)}),G=(x=k.ref)!=null?x:y;return F.children?A.createElement(r,w(s({},F),{ref:G})):A.createElement(r,w(s({},F),{ref:G}),v)}}Te.displayName="PrimeReact.Component";import{omit as Ie}from"@primeuix/utils";var $={ref:void 0,pIf:!0,style:void 0,className:void 0,as:void 0,asChild:!1,pt:void 0,ptOptions:void 0,unstyled:void 0,dt:void 0,styles:void 0,children:void 0},ze=w(s({},Ie($,"pt","ptOptions","dt","styles")),{instance:void 0,attrs:void 0});import{useBase as Ae}from"@primereact/core/base";import*as q from"react";import{useMountEffect as xe,useUnmountEffect as Oe,useUpdateEffect as _e}from"@primereact/hooks";import{mergeProps as ee}from"@primeuix/utils/mergeprops";import{getKeyValue as Q,isArray as Ee,isFunction as Me,isNotEmpty as Le,isString as te,resolve as me,toFlatCase as ie}from"@primeuix/utils/object";import*as g from"react";function de(c,u){var G,re,ae;let{id:l,name:a,scope:m,part:P,props:n,attrs:e,$primereact:r,$attrSelector:d}=c||{},h=g.useCallback(t=>{let o=v(k(n.pt,a),Q,`hooks.${t}`),p=T(Q,`hooks.${t}`);o==null||o(),p==null||p()},[n.pt,a]),y=g.useCallback((t,...o)=>Me(t)?t(...o):t?ee(...o):Object.assign({},...o),[]),f=g.useCallback((t={},o="",p={},R=!0)=>{var ce;let O=/./g.test(o)&&!!p[o.split(".")[0]],{mergeSections:L=!0,mergeProps:C=!1}=(n==null?void 0:n.ptOptions)||((ce=r.passthrough)==null?void 0:ce.options)||{},K=R?O?_(j,o,p):T(j,o,p):void 0,E=O?void 0:b(t,j,o,w(s({},p),{global:K||{}})),M=N(o);return L||!L&&E?y(C,K,E,M):s(s({},E),M)},[n.ptOptions,y]),N=g.useCallback((t="")=>{let o="data-";return t==="root"&&Le(e["data-scope"])?{[`${o}extend`]:m}:w(s({[`${o}scope`]:m},t==="root"&&{[`${o}part`]:P,[`${o}id`]:d}),{[`${o}slot`]:t})},[n.pt,d,a]),j=g.useCallback((t={},o="",p)=>{let R=Q(t,o,p);return te(R)||Ee(R)?{className:R}:R},[]),k=g.useCallback((t,o="",p)=>{let R=(O,L=!1)=>{var M;let C=p?p(O):O,K=ie(o),E=ie(a);return(M=L?K!==E?C==null?void 0:C[K]:void 0:C==null?void 0:C[K])!=null?M:C};return t&&Object.hasOwn(t,"_usept")?{_usept:t._usept,originalValue:R(t.originalValue),value:R(t.value)}:R(t,!0)},[]),v=g.useCallback((t,o,p="",R)=>{var L;let O=C=>o(C,p,R);if(t&&Object.hasOwn(t,"_usept")){let{mergeSections:C=!0,mergeProps:K=!1}=t._usept||((L=r.passthrough)==null?void 0:L.options)||{},E=O(t.originalValue),M=O(t.value);return E===void 0&&M===void 0?void 0:te(M)?M:te(E)?E:C||!C&&M?y(K,E,M):M}return O(t)},[(G=r.passthrough)==null?void 0:G.options,y]),H=g.useMemo(()=>{var t;return k((t=r==null?void 0:r.passthrough)==null?void 0:t.value,void 0,o=>me(o,c))},[(re=r==null?void 0:r.passthrough)==null?void 0:re.value]),U=g.useMemo(()=>{var t;return k((t=r==null?void 0:r.passthrough)==null?void 0:t.value,void 0,o=>Q(o,a,c)||me(o,c))},[(ae=r==null?void 0:r.passthrough)==null?void 0:ae.value]),D=g.useMemo(()=>Object.entries(e||{}).filter(([t])=>t==null?void 0:t.startsWith("pt-")).reduce((t,[o,p])=>{let[,R,...O]=o.split("-");return[R,O==null?void 0:O.join("-")].filter(Boolean).reduce((L,C,K,E)=>(L[C]||(L[C]=K===E.length-1?p:{}),L[C]),t),t},{}),[e]),i=g.useMemo(()=>Object.entries(e||{}).filter(([t])=>!(t!=null&&t.startsWith("pt-"))).reduce((t,[o,p])=>(t[o]=p,t),{}),[e]),b=g.useCallback((t={},o,p="",R)=>ee(v(k(t,a),o,p,R),v(D,o,p,R)),[D]),_=g.useCallback((t,o="",p)=>v(H,t,o,p),[H]),T=g.useCallback((t,o,p)=>v(U,t,o,p),[U]),S=g.useCallback((t="",o={})=>f(n.pt,t,s(s({},u),o)),[n.pt,u]),x=g.useCallback((t="",o={})=>{var R;let p=ee(i,S(t,o));return p&&Object.hasOwn(p,"id")&&((R=p.id)!=null||(p.id=l)),p},[S,l,i]),F=g.useCallback((t={},o="",p={})=>f(t,o,s(s({},u),p),!1),[u]);return xe(()=>h("onMounted")),_e(()=>h("onUpdated")),Oe(()=>h("onUnmounted")),g.useMemo(()=>({ptm:S,ptmi:x,ptmo:F}),[S,x,F])}import{StyleRegistry as X}from"@primereact/core/utils";import{Theme as W,ThemeService as je}from"@primeuix/styled";import{cn as De,getKeyValue as se}from"@primeuix/utils";import*as I from"react";import{ThemeContext as Ne}from"@primereact/core/theme";import{useStyle as ve}from"@primereact/core/use-style";import{css as ne,dt as fe,Theme as B}from"@primeuix/styled";import{isNotEmpty as Fe,minifyCSS as oe,resolve as ye,toElement as Ke}from"@primeuix/utils";import*as V from"react";function Re(c,u){let l=V.useContext(Ne),[a]=ve(),m=V.useCallback((P,n)=>a({name:n==null?void 0:n.name,css:P,element:Ke(u),options:n}),[a,u]);return V.useMemo(()=>{let P=w(s({name:"base"},c),{load(n="",e={},r="",d=!1){let h=e.name||P.name,y=ne`${n}${r}`,f=d?B.transformCSS(h,y):y;return Fe(f)?m(oe(f),s({name:h},e)):{}},loadCSS(n){return this.load(this.css,n)},loadStyle(n,e=""){return this.load(this.style,n,e,!0)},getCommonTheme(n){return B.getCommon(this.name,n)},getComponentTheme(n){return B.getComponent(this.name,n)},getPresetTheme(n,e,r){return B.getCustomPreset(this.name,n,e,r)},getLayerOrderThemeCSS(){return B.getLayerOrderCSS(this.name)},getStyleSheet(n="",e={}){if(this.css){let r=ye(this.css,{dt:fe}),d=oe(ne`${r}${n}`),h=Object.entries(e).reduce((y,[f,N])=>(y.push(`${f}="${N}"`),y),[]).join(" ");return`<style type="text/css" data-primereact-style-id="${this.name}" ${h}>${d}</style>`}return""},getCommonThemeStyleSheet(n,e={}){return B.getCommonStyleSheet(this.name,n,e)},getThemeStyleSheet(n,e={}){let r=[B.getStyleSheet(this.name,n,e)];if(l){let d=this.name==="base"?"global-style":`${this.name}-style`,h=ne`${ye(l,{dt:fe})}`,y=oe(B.transformCSS(this.name,h)),f=Object.entries(e).reduce((N,[j,k])=>(N.push(`${j}="${k}"`),N),[]).join(" ");r.push(`<style type="text/css" data-primereact-style-id="${d}" ${f}>${y}</style>`)}return r.join("")}});return P},[c,l,m])}function ge(c,u,l){var D;let{props:a={unstyled:!1,dt:void 0},$primereact:m,$attrSelector:P,elementRef:n}=c||{},e=Re(u,n),r=I.useRef(null),d=I.useCallback(()=>{if(!X.isStyleNameLoaded("base")){let{css:i}=e.baseStyles||{};e.load(i,s({name:"base"},f)),X.setLoadedStyleName("base")}j()},[e]),h=I.useCallback(()=>{d(),v(d)},[d]),y=I.useMemo(()=>{var i;return a.unstyled!==void 0?a.unstyled:(i=m==null?void 0:m.config)==null?void 0:i.unstyled},[a,m==null?void 0:m.config]),f=I.useMemo(()=>{var i,b;return{nonce:(b=(i=m==null?void 0:m.config)==null?void 0:i.csp)==null?void 0:b.nonce}},[m==null?void 0:m.config]),N=I.useCallback(()=>{if(!X.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let i=e.name==="global"?"base":e.name;e.loadCSS(s({name:i},f)),X.setLoadedStyleName(e.name)}},[e,f]),j=I.useCallback(()=>{var i,b,_,T;if(!(y||(m==null?void 0:m.theme)==="none")){if(!W.isStyleNameLoaded("common")){let{primitive:S,semantic:x,global:F,style:G}=((i=e==null?void 0:e.getCommonTheme)==null?void 0:i.call(e))||{};e.load(S==null?void 0:S.css,s({name:"primitive-variables"},f)),e.load(x==null?void 0:x.css,s({name:"semantic-variables"},f)),e.load(F==null?void 0:F.css,s({name:"global-variables"},f)),e.load((b=e.baseStyles)==null?void 0:b.style,s({name:"global-style"},f),G,!0),W.setLoadedStyleName("common")}if(!W.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let{css:S,style:x}=((_=e==null?void 0:e.getComponentTheme)==null?void 0:_.call(e))||{};e.load(S,s({name:`${e.name}-variables`},f)),e.loadStyle(s({name:`${e.name}-style`},f),x),W.setLoadedStyleName(e.name)}if(!W.isStyleNameLoaded("layer-order")){let S=(T=e==null?void 0:e.getLayerOrderThemeCSS)==null?void 0:T.call(e);e.load(S,s({name:"layer-order",first:!0},f)),W.setLoadedStyleName("layer-order")}}},[y,e,f]),k=i=>{var T;let{css:b}=((T=e==null?void 0:e.getPresetTheme)==null?void 0:T.call(e,i,`[${P}]`))||{},_=e==null?void 0:e.load(b,s({name:`${P}-${e.name}`},f));r.current=_},v=I.useCallback((i=()=>{})=>{je.on("theme:change",i)},[]),H=I.useCallback((i="",b={})=>y?void 0:De(se(e.classes,i,w(s({},l),{context:b}))),[y,c,e.classes]),U=I.useCallback((i="",b=!0,_={})=>{var T;if(b){let S=se(e.inlineStyles,i,w(s({},l),{context:_})),x=se((T=e.baseStyles)==null?void 0:T.inlineStyles,i,w(s({},l),{context:_}));return s(s({},x),S)}},[e.inlineStyles,(D=e.baseStyles)==null?void 0:D.inlineStyles,c]);return y||(N(),h(),k(a.dt)),I.useMemo(()=>({cx:H,sx:U,isUnstyled:y,$style:e}),[H,U,y,e])}function Ce(c="UnknownComponent",u={}){let l=q.useMemo(()=>s(s({},$),u.defaultProps),[u.defaultProps]),a=Ae(c,{inProps:u.inProps,defaultProps:l,setup:u.setup}),{ref:m,props:P}=a,n=q.useMemo(()=>({instance:a,props:a.props,attrs:a.attrs,state:a.state}),[a.props,a.attrs,a.state]),e=de(a,n),r=ge(a,P.styles||u.styles,n),d=q.useMemo(()=>s(s(s({},a),e),r),[a,e,r]);return q.useImperativeHandle(m,()=>d,[d]),d}import{isObject as Pe,shallowEqualProps as Be}from"@primeuix/utils";import*as Y from"react";function ht({name:c="UnknownComponent",defaultProps:u,styles:l,components:a,setup:m,render:P}){let e=Y.memo(r=>{let d=Ce(c,{inProps:r,defaultProps:u,styles:l,setup:m}),h=P!=null?P:(()=>null);return d.props.pIf?Y.createElement(h,s({},d)):null},(r,d)=>!Pe(r)||!Pe(d)?!1:Be(r,d));return e.displayName=`PrimeReact.${c}`,Object.entries(a||{}).forEach(([r,d])=>{e[r]=d}),e}export{Te as Component,ze as defaultComponentProps,$ as globalProps,Ce as useComponent,ht as withComponent};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/component/Component.tsx","../../src/component/Component.props.ts","../../src/component/useComponent.ts","../../src/component/useComponentPT.ts","../../src/component/useComponentStyle.ts","../../src/component/useComponentStyleHandler.ts","../../src/component/withComponent.tsx"],"sourcesContent":["import { isValidElement } from '@primereact/core/utils';\nimport type { ComponentInstance, ComponentProps } from '@primereact/types/core';\nimport { cn, resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A component wrapper for rendering elements with additional props and attributes.\n * @param inProps The properties to pass to the component.\n * @returns A React element or null if `pIf` is false.\n */\nexport function Component<I extends ComponentInstance = ComponentInstance>(inProps: ComponentProps<I> = {}) {\n const { pIf = true, style, className, as, asChild, instance, ...props } = inProps;\n\n if (pIf === false) return null;\n\n const AsComponent = (as || instance?.props?.as || React.Fragment) as React.ElementType;\n const renderAsChild = asChild || instance?.props?.asChild;\n const isFragment = AsComponent === React.Fragment;\n\n const { ref = instance?.elementRef, children, attrs: inAttrs, ...restAttrs } = props;\n const attrs = { ...inAttrs, ...restAttrs } as React.HTMLAttributes<HTMLElement>;\n // @ts-expect-error: Update resolve to handle attrs correctly\n const content = resolve(children, instance, attrs) as React.ReactNode;\n const styles = resolve(style || instance?.props?.style, instance) as React.CSSProperties | undefined;\n const classNames = resolve(className || instance?.props?.className, instance) as string | undefined;\n\n return renderAsChild || isFragment ? (\n <React.Fragment>{content}</React.Fragment>\n ) : isValidElement(AsComponent) ? (\n resolve(AsComponent, instance)\n ) : (\n <AsComponent {...attrs} ref={ref} style={{ ...attrs.style, ...styles }} className={cn(attrs.className, classNames)}>\n {content}\n </AsComponent>\n );\n}\n\nComponent.displayName = 'PrimeReact.Component';\n","import type { ComponentProps, GlobalComponentProps } from '@primereact/types/core';\nimport { omit } from '@primeuix/utils';\n\nexport const globalProps: GlobalComponentProps = {\n ref: undefined,\n pIf: true,\n style: undefined,\n className: undefined,\n as: undefined,\n asChild: false,\n pt: undefined,\n ptOptions: undefined,\n unstyled: undefined,\n dt: undefined,\n children: undefined\n};\n\nexport const defaultComponentProps: ComponentProps = {\n ...(omit(globalProps, 'pt', 'ptOptions', 'dt', 'styles') as Record<PropertyKey, unknown>),\n instance: undefined,\n attrs: undefined\n};\n","import { useBase } from '@primereact/core/base';\nimport type { InComponentInstance, useBaseOptions, useComponentOptions } from '@primereact/types/core';\nimport * as React from 'react';\nimport { globalProps } from './Component.props';\nimport { useComponentPT } from './useComponentPT';\nimport { useComponentStyle } from './useComponentStyle';\n\n/**\n * A hook for creating a component instance.\n * This hook initializes a component with properties, attributes, and styles, and provides methods for handling pass-through options and styles.\n * It also supports custom setup functions for additional configuration.\n *\n * @param name The name of the component, used for debugging and identification.\n * @param options The options to customize the component instance.\n * @returns The component instance.\n */\nexport function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name: string = 'UnknownComponent', options: useComponentOptions<IProps, DProps, Exposes, Styles> = {}) {\n const defaultProps = React.useMemo(() => ({ ...globalProps, ...options.defaultProps }), [options.defaultProps]);\n const baseInstance = useBase(name, {\n inProps: options.inProps,\n defaultProps,\n setup: options.setup\n } as useBaseOptions<IProps & { id?: string; ref?: React.Ref<unknown> }, typeof defaultProps, Exposes>);\n\n const { ref, props } = baseInstance;\n const $params = React.useMemo(() => {\n return {\n instance: baseInstance,\n props: baseInstance.props,\n attrs: baseInstance.attrs,\n state: baseInstance.state\n };\n }, [baseInstance.props, baseInstance.attrs, baseInstance.state]);\n\n const ptx = useComponentPT(baseInstance, $params);\n const stx = useComponentStyle(baseInstance, props.styles || options.styles, $params);\n\n const instance = React.useMemo<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>(\n () => ({\n ...baseInstance,\n ...ptx,\n ...stx\n }),\n [baseInstance, ptx, stx]\n );\n\n React.useImperativeHandle(ref as React.Ref<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n}\n","import { useMountEffect, useUnmountEffect, useUpdateEffect } from '@primereact/hooks';\nimport type { GlobalComponentProps, Instance, PassThroughOptions, useComponentPTReturnType } from '@primereact/types/core';\nimport { mergeProps } from '@primeuix/utils/mergeprops';\nimport { getKeyValue, isArray, isFunction, isNotEmpty, isString, resolve, toFlatCase } from '@primeuix/utils/object';\nimport * as React from 'react';\n\n/**\n * A hook for managing pass-through options for a component.\n *\n * @param instance The instance of the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the pass-through options.\n */\nexport function useComponentPT<Props extends GlobalComponentProps, IProps, Params>(instance: Instance<Props, IProps>, $params?: Params): useComponentPTReturnType {\n const { id, name, props, attrs, $primereact, $attrSelector } = instance || {};\n\n // methods\n const _hook = React.useCallback(\n (hookName: string) => {\n const selfHook = _usePT(_getPT(props.pt, name), getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n const defaultHook = _useDefaultPT(getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n\n selfHook?.();\n defaultHook?.();\n },\n [props.pt, name]\n );\n\n const _mergeProps = React.useCallback(<T extends unknown[], R = Record<PropertyKey, unknown>>(fn: ((...args: T) => R | undefined) | boolean, ...args: T): R => {\n return (isFunction(fn) ? fn(...args) : fn ? mergeProps(...args) : Object.assign({}, ...args)) as R;\n }, []);\n\n const _getPTValue = React.useCallback(\n (obj = {}, key = '', params: Record<string, unknown> = {}, searchInDefaultPT = true) => {\n const searchOut = /./g.test(key) && !!params[key.split('.')[0]];\n const { mergeSections = true, mergeProps: useMergeProps = false } = props?.ptOptions || $primereact.config?.ptOptions || {};\n const global = searchInDefaultPT ? (searchOut ? _useGlobalPT(_getPTClassValue, key, params) : _useDefaultPT(_getPTClassValue, key, params)) : undefined;\n const self = searchOut ? undefined : _getPTSelf(obj, _getPTClassValue, key, { ...params, global: global || {} });\n const datasets = _getPTDatasets(key);\n\n return mergeSections || (!mergeSections && self) ? _mergeProps(useMergeProps, global, self, datasets) : { ...self, ...datasets };\n },\n [props.ptOptions, _mergeProps]\n );\n\n const _getPTDatasets = React.useCallback(\n (key = '') => {\n const datasetPrefix = 'data-pc-';\n const isExtended = key === 'root' && isNotEmpty(props?.pt?.['data-pc-section']);\n\n return (\n key !== 'transition' && {\n ...(key === 'root' && {\n [`${datasetPrefix}name`]: toFlatCase((isExtended ? props.pt?.['data-pc-section'] : name) as string),\n ...(isExtended && { [`${datasetPrefix}extend`]: toFlatCase(name!) }),\n [`${$attrSelector}`]: ''\n }),\n [`${datasetPrefix}section`]: toFlatCase(key)\n }\n );\n },\n [props.pt, $attrSelector]\n );\n\n const _getPTClassValue = React.useCallback((obj: Record<string, unknown> = {}, key = '', params?: Record<string, unknown>) => {\n const value = getKeyValue(obj, key, params);\n\n return isString(value) || isArray(value) ? { className: value } : value;\n }, []);\n\n const _getPT = React.useCallback(<Fn extends (...args: unknown[]) => unknown>(pt?: Record<string, unknown>, key = '', fn?: Fn) => {\n const getValue = (value: unknown, checkSameKey = false) => {\n const computedValue = (fn ? fn(value) : value) as Record<string, unknown>;\n const _key = toFlatCase(key);\n const _cKey = toFlatCase(name!);\n\n return ((checkSameKey ? (_key !== _cKey ? computedValue?.[_key] : undefined) : computedValue?.[_key]) ?? computedValue) as Record<string, unknown>;\n };\n\n return pt && Object.hasOwn(pt, '_usept')\n ? {\n _usept: pt['_usept'],\n originalValue: getValue(pt.originalValue),\n value: getValue(pt.value)\n }\n : getValue(pt, true);\n }, []);\n\n const _usePT = React.useCallback(\n <Fn>(pt: Record<string, unknown>, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n const vfn = (value: unknown) => (fn as (...args: unknown[]) => unknown)(value, key, params);\n\n if (pt && Object.hasOwn(pt, '_usept')) {\n const { mergeSections = true, mergeProps: useMergeProps = false } = (pt['_usept'] || $primereact.config?.ptOptions || {}) as PassThroughOptions;\n const originalValue = vfn(pt.originalValue);\n const value = vfn(pt.value);\n\n if (originalValue === undefined && value === undefined) return undefined;\n else if (isString(value)) return value;\n else if (isString(originalValue)) return originalValue;\n\n return mergeSections || (!mergeSections && value) ? _mergeProps(useMergeProps, originalValue, value) : value;\n }\n\n return vfn(pt);\n },\n [$primereact.config?.ptOptions, _mergeProps]\n );\n\n // computed values\n const $globalPT = React.useMemo(() => _getPT($primereact?.config?.pt, undefined, (value) => resolve(value, instance)), [$primereact?.config?.pt]);\n const $defaultPT = React.useMemo(() => _getPT($primereact?.config?.pt, undefined, (value) => getKeyValue(value as Record<string, unknown>, name, instance) || resolve(value, instance)), [$primereact?.config?.pt]);\n const $attrsPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((result, [key, value]) => {\n const [, slot, ...rest] = key.split('-');\n\n [slot, rest?.join('-')]?.reduce((currentObj, nestedKey, index, array) => {\n if (!currentObj[nestedKey]) {\n currentObj[nestedKey] = index === array.length - 1 ? value : {};\n }\n\n return currentObj[nestedKey] as Record<string, unknown>;\n }, result);\n\n return result;\n }, {});\n }, [attrs]);\n const $attrsWithoutPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => !key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((acc, [key, value]) => {\n acc[key] = value;\n\n return acc;\n }, {});\n }, [attrs]);\n\n // helpers\n const _getPTSelf = React.useCallback(\n <Fn>(obj: Record<string, unknown> = {}, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return mergeProps(\n _usePT(_getPT(obj, name), fn, key, params), // Exp; <PRComponent pt={{ [passthrough_key]: { [attribute]: value } }}>\n _usePT($attrsPT, fn, key, params) // Exp; <PRComponent pt:[passthrough_key]:[attribute]={value}> or <PRComponent pt:[passthrough_key]={() =>{value}}>\n );\n },\n [$attrsPT]\n );\n\n const _useGlobalPT = React.useCallback(\n <Fn>(fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return _usePT($globalPT, fn, key, params);\n },\n [$globalPT]\n );\n\n const _useDefaultPT = React.useCallback(\n <Fn>(fn: Fn, key: string, params?: Record<string, unknown>) => {\n return _usePT($defaultPT, fn, key, params);\n },\n [$defaultPT]\n );\n\n // exposed methods\n const ptm = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(props.pt, key, { ...$params, ...params }) as Record<string, unknown>;\n },\n [props.pt, $params]\n );\n\n const ptmi = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n const _attrs = mergeProps($attrsWithoutPT, ptm(key, params)) as Record<string, unknown>;\n\n if (_attrs && Object.hasOwn(_attrs, 'id')) {\n _attrs.id ??= id;\n }\n\n return _attrs as Record<string, unknown>;\n },\n [ptm, id, $attrsWithoutPT]\n );\n\n const ptmo = React.useCallback(\n (obj: Record<string, unknown> = {}, key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(obj, key, { ...$params, ...params }, false) as Record<string, unknown>;\n },\n [$params]\n );\n\n // hooks\n useMountEffect(() => _hook('onMounted'));\n useUpdateEffect(() => _hook('onUpdated'));\n useUnmountEffect(() => _hook('onUnmounted'));\n\n return React.useMemo(\n () => ({\n ptm,\n ptmi,\n ptmo\n }),\n [ptm, ptmi, ptmo]\n );\n}\n","import { StyleRegistry } from '@primereact/core/utils';\nimport type { GlobalComponentProps, Instance, useComponentStyleReturnType } from '@primereact/types/core';\nimport { Theme, ThemeService } from '@primeuix/styled';\nimport { cn, getKeyValue } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponentStyleHandler } from './useComponentStyleHandler';\n\n/**\n * A hook for managing component styles.\n *\n * @param instance The instance of the component.\n * @param styles The styles to apply to the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the component styles.\n */\nexport function useComponentStyle<Props extends GlobalComponentProps, IProps, Styles, Params>(instance: Instance<Props, IProps>, styles?: Styles, $params?: Params): useComponentStyleReturnType {\n const { props = { unstyled: false, dt: undefined }, $primereact, $attrSelector, elementRef } = instance || {};\n const $style = useComponentStyleHandler(styles, elementRef);\n\n // refs\n const scopedStyleRef = React.useRef<HTMLStyleElement | null>(null);\n\n // methods\n const _load = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded('base')) {\n const { css } = $style.baseStyles || {};\n\n $style.load(css, { name: 'base', ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName('base');\n }\n\n _loadThemeStyles();\n }, [$style]);\n\n const _loadStyles = React.useCallback(() => {\n _load();\n _themeChangeListener(_load);\n }, [_load]);\n\n // computed values\n const $isUnstyled = React.useMemo(() => (props.unstyled !== undefined ? props.unstyled : $primereact?.config?.unstyled), [props, $primereact?.config]);\n const $styleOptions = React.useMemo(() => ({ nonce: $primereact?.config?.csp?.nonce }), [$primereact?.config]);\n\n // helpers\n const _loadCoreStyles = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded($style?.name) && $style?.name) {\n const name = $style.name === 'global' ? 'base' : $style.name;\n\n $style.loadCSS({ name, ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName($style.name);\n }\n }, [$style, $styleOptions]);\n\n const _loadThemeStyles = React.useCallback(() => {\n if ($isUnstyled || $primereact?.theme === 'none') return;\n\n // common\n if (!Theme.isStyleNameLoaded('common')) {\n const { primitive, semantic, global, style } = $style?.getCommonTheme?.() || {};\n\n $style.load(primitive?.css, { name: 'primitive-variables', ...$styleOptions });\n $style.load(semantic?.css, { name: 'semantic-variables', ...$styleOptions });\n $style.load(global?.css, { name: 'global-variables', ...$styleOptions });\n $style.load($style.baseStyles?.style, { name: 'global-style', ...$styleOptions }, style, true);\n\n Theme.setLoadedStyleName('common');\n }\n\n // component\n if (!Theme.isStyleNameLoaded($style?.name) && $style?.name) {\n const { css, style } = $style?.getComponentTheme?.() || {};\n\n $style.load(css, { name: `${$style.name}-variables`, ...$styleOptions });\n $style.loadStyle({ name: `${$style.name}-style`, ...$styleOptions }, style);\n\n Theme.setLoadedStyleName($style.name);\n }\n\n // layer order\n if (!Theme.isStyleNameLoaded('layer-order')) {\n const layerOrder = $style?.getLayerOrderThemeCSS?.();\n\n $style.load(layerOrder, { name: 'layer-order', first: true, ...$styleOptions });\n\n Theme.setLoadedStyleName('layer-order');\n }\n }, [$isUnstyled, $style, $styleOptions]);\n\n const _loadScopedThemeStyles = (preset: unknown) => {\n const { css } = $style?.getPresetTheme?.(preset, `[${$attrSelector}]`) || {};\n const scopedStyle = $style?.load(css, { name: `${$attrSelector}-${$style.name}`, ...$styleOptions });\n\n scopedStyleRef.current = scopedStyle as HTMLStyleElement;\n };\n\n /*const _unloadScopedThemeStyles = () => {\n scopedStyleRef.current?.remove();\n };*/\n\n const _themeChangeListener = React.useCallback((callback = () => {}) => {\n //if (!StyleRegistry.isStyleNameLoaded('base')) {\n //StyleRegistry.clearLoadedStyleNames();\n ThemeService.on('theme:change', callback);\n //}\n }, []);\n\n /*const _removeThemeListeners = () => {\n ThemeService.off('theme:change', _loadCoreStyles);\n ThemeService.off('theme:change', _load);\n ThemeService.off('theme:change', _themeScopedListener);\n };*/\n\n // exposed methods\n const cx = React.useCallback(\n (key = '', params = {}) => {\n return !$isUnstyled ? cn(getKeyValue($style.classes as Record<string, string>, key, { ...$params, context: params })) : undefined;\n },\n [$isUnstyled, instance, $style.classes]\n );\n\n const sx = React.useCallback(\n (key = '', when = true, params = {}) => {\n if (when) {\n const self = getKeyValue($style.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n const base = getKeyValue($style.baseStyles?.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n\n return { ...base, ...self };\n }\n\n return undefined;\n },\n [$style.inlineStyles, $style.baseStyles?.inlineStyles, instance]\n );\n\n // effects\n if (!$isUnstyled) {\n // @todo - remove\n //Theme.clearLoadedStyleNames();\n //StyleRegistry.clearLoadedStyleNames();\n _loadCoreStyles();\n _loadStyles();\n _loadScopedThemeStyles(props.dt);\n }\n\n return React.useMemo(\n () => ({\n cx,\n sx,\n isUnstyled: $isUnstyled,\n $style\n }),\n [cx, sx, $isUnstyled, $style]\n );\n}\n","import { ThemeContext } from '@primereact/core/theme';\nimport { useStyle } from '@primereact/core/use-style';\nimport type { StylesOptions, StyleType } from '@primereact/types/styles';\nimport { css as Css, dt, Theme } from '@primeuix/styled';\nimport { isNotEmpty, minifyCSS, resolve, toElement } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for managing component styles.\n *\n * @param styles The styles to apply to the component.\n * @param elementRef A reference to the HTML element.\n * @returns An object containing methods to load and manage styles.\n */\nexport function useComponentStyleHandler<Styles>(styles?: Styles, elementRef?: React.Ref<HTMLElement>) {\n const theme = React.useContext(ThemeContext);\n const [load] = useStyle();\n\n const _load = React.useCallback(\n (css?: string, options?: Record<PropertyKey, unknown>) => {\n return load({ name: options?.name as string | undefined, css, element: toElement(elementRef), options });\n },\n [load, elementRef]\n );\n\n return React.useMemo(() => {\n const handler = {\n name: 'base',\n ...(styles as StylesOptions),\n load(style: StyleType = '', options: Record<PropertyKey, unknown> & { name?: string } = {}, extendedStyle = '', enableThemeTransform = false) {\n const name = options.name || handler.name;\n const resolvedStyle = Css`${style}${extendedStyle}` as string;\n const computedStyle = enableThemeTransform ? Theme.transformCSS(name, resolvedStyle) : resolvedStyle;\n\n return isNotEmpty(computedStyle) ? _load(minifyCSS(computedStyle), { name, ...options }) : {};\n },\n loadCSS(options?: Record<PropertyKey, unknown>) {\n return this.load(this.css, options);\n },\n loadStyle(options?: Record<PropertyKey, unknown>, extendedStyle = '') {\n return this.load(this.style, options, extendedStyle, true);\n },\n getCommonTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getCommon(this.name, params);\n },\n getComponentTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getComponent(this.name, params);\n },\n // @todo: preset type\n getPresetTheme(preset: unknown, selector: string, params?: Record<PropertyKey, unknown>) {\n return Theme.getCustomPreset(this.name, preset, selector, params);\n },\n getLayerOrderThemeCSS() {\n return Theme.getLayerOrderCSS(this.name);\n },\n getStyleSheet(extendedCSS = '', props = {}) {\n if (this.css) {\n // @ts-expect-error: update dt definition in primeuix/styled\n const _css = resolve(this.css, { dt }) as string;\n const _style = minifyCSS(Css`${_css}${extendedCSS}`);\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n return `<style type=\"text/css\" data-primereact-style-id=\"${this.name}\" ${_props}>${_style}</style>`;\n }\n\n return '';\n },\n getCommonThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n return Theme.getCommonStyleSheet(this.name, params, props);\n },\n getThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n const cssArr = [Theme.getStyleSheet(this.name, params, props)];\n\n if (theme) {\n const _name = this.name === 'base' ? 'global-style' : `${this.name}-style`;\n const _css = Css`${resolve(theme, { dt })}` as string;\n const _style = minifyCSS(Theme.transformCSS(this.name, _css));\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n cssArr.push(`<style type=\"text/css\" data-primereact-style-id=\"${_name}\" ${_props}>${_style}</style>`);\n }\n\n return cssArr.join('');\n }\n };\n\n return handler;\n }, [styles, theme, _load]);\n}\n","import type { ComponentInstance, InComponentInstance, useComponentOptions, withComponentOptions } from '@primereact/types/core';\nimport type { BaseComponentProps } from '@primereact/types/shared';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { isObject } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponent } from './useComponent';\n\n/**\n * A higher-order component for enhancing a component with additional features.\n *\n * @template IProps The interface for the component's input properties.\n * @template DProps The interface for the component's default properties.\n * @template Exposes The interface for the properties that the component exposes.\n * @template Styles The styles options for the component.\n * @template CData Additional data to expose on the component.\n *\n * @param options The options for the component.\n * @param options.name The name of the component, used for debugging and identification.\n * @param options.defaultProps The default properties for the component.\n * @param options.styles The styles to apply to the component.\n * @param options.components Additional components to include in the component.\n * @param options.setup A setup function for additional configuration of the component.\n * @param options.render A render function for the component.\n * @returns A React component wrapped with the specified options.\n */\nexport function withComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) {\n type InProps<I extends ComponentInstance, T extends React.ElementType> = BaseComponentProps<I, IProps, unknown, T> & DProps;\n\n const BaseComponent = <I extends ComponentInstance, T extends React.ElementType>(inProps?: InProps<I, T>) => {\n const instance = useComponent(name, { inProps, defaultProps, styles, setup } as useComponentOptions<InProps<I, T>, DProps, Exposes, Styles>);\n\n type RenderedComponentProps = InComponentInstance<typeof instance.props, InProps<I, T>, typeof instance.state, Exposes>;\n\n const RenderedComponent = (render as React.FC<RenderedComponentProps>) ?? (() => null);\n\n return instance.props.pIf ? <RenderedComponent {...(instance as RenderedComponentProps)} /> : null;\n };\n\n const Component = React.memo(BaseComponent, (prevProps, nextProps) => {\n if (!isObject(prevProps) || !isObject(nextProps)) {\n return false;\n }\n\n // Compare shallow equality for all defaultProps keys\n return prevProps === nextProps && Object.keys(defaultProps || {}).every((key) => (prevProps as Record<string, unknown>)[key] === (nextProps as Record<string, unknown>)[key]);\n }) as unknown as typeof BaseComponent & CData & React.FC;\n\n Component.displayName = `PrimeReact.${name}`;\n Object.entries(components || {}).forEach(([key, value]) => {\n (Component as Record<string, unknown>)[key] = value;\n });\n\n return Component;\n}\n"],"mappings":"8lBAAA,OAAS,kBAAAA,OAAsB,yBAE/B,OAAS,MA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,GAC1C,OAAO,QAAQG,GAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACY,EAAKC,CAAK,IAAM,CACtDV,EAAsCS,CAAG,EAAIC,CAClD,CAAC,EAEMV,CACX","names":["isValidElement","cn","resolve","React","Component","inProps","_b","_c","_e","_f","_a","pIf","style","className","as","asChild","instance","props","__objRest","AsComponent","renderAsChild","isFragment","_d","ref","children","inAttrs","restAttrs","attrs","__spreadValues","content","resolve","styles","classNames","isValidElement","__spreadProps","cn","omit","globalProps","defaultComponentProps","__spreadProps","__spreadValues","omit","useBase","React","useMountEffect","useUnmountEffect","useUpdateEffect","mergeProps","getKeyValue","isArray","isFunction","isNotEmpty","isString","resolve","toFlatCase","React","useComponentPT","instance","$params","_a","_b","_c","id","name","props","attrs","$primereact","$attrSelector","_hook","hookName","selfHook","_usePT","_getPT","getKeyValue","defaultHook","_useDefaultPT","_mergeProps","fn","args","isFunction","mergeProps","_getPTValue","obj","key","params","searchInDefaultPT","searchOut","mergeSections","useMergeProps","global","_useGlobalPT","_getPTClassValue","self","_getPTSelf","__spreadProps","__spreadValues","datasets","_getPTDatasets","datasetPrefix","isExtended","isNotEmpty","toFlatCase","value","isString","isArray","pt","getValue","checkSameKey","computedValue","_key","_cKey","vfn","originalValue","$globalPT","resolve","$defaultPT","$attrsPT","result","slot","rest","currentObj","nestedKey","index","array","$attrsWithoutPT","acc","ptm","ptmi","_attrs","ptmo","useMountEffect","useUpdateEffect","useUnmountEffect","StyleRegistry","Theme","ThemeService","cn","getKeyValue","React","ThemeContext","useStyle","Css","dt","Theme","isNotEmpty","minifyCSS","resolve","toElement","React","useComponentStyleHandler","styles","elementRef","theme","ThemeContext","load","useStyle","_load","css","options","toElement","handler","__spreadProps","__spreadValues","style","extendedStyle","enableThemeTransform","name","resolvedStyle","Css","computedStyle","Theme","isNotEmpty","minifyCSS","params","preset","selector","extendedCSS","props","_css","resolve","dt","_style","_props","acc","k","v","cssArr","_name","useComponentStyle","instance","styles","$params","_a","props","$primereact","$attrSelector","elementRef","$style","useComponentStyleHandler","scopedStyleRef","_load","StyleRegistry","css","__spreadValues","$styleOptions","_loadThemeStyles","_loadStyles","_themeChangeListener","$isUnstyled","_b","_loadCoreStyles","name","_c","_d","Theme","primitive","semantic","global","style","layerOrder","_loadScopedThemeStyles","preset","scopedStyle","callback","ThemeService","cx","key","params","cn","getKeyValue","__spreadProps","sx","when","self","base","useComponent","name","options","defaultProps","__spreadValues","globalProps","baseInstance","useBase","ref","props","$params","ptx","useComponentPT","stx","useComponentStyle","instance","isObject","React","withComponent","name","defaultProps","styles","components","setup","render","Component","inProps","instance","useComponent","RenderedComponent","__spreadValues","prevProps","nextProps","isObject","key","value"]}
1
+ {"version":3,"sources":["../../src/component/Component.tsx","../../src/component/Component.props.ts","../../src/component/useComponent.ts","../../src/component/useComponentPT.ts","../../src/component/useComponentStyle.ts","../../src/component/useComponentStyleHandler.ts","../../src/component/withComponent.tsx"],"sourcesContent":["import { isValidElement } from '@primereact/core/utils';\nimport type { ComponentInstance, ComponentProps } from '@primereact/types/core';\nimport { cn, resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A component wrapper for rendering elements with additional props and attributes.\n * @param inProps The properties to pass to the component.\n * @returns A React element or null if `pIf` is false.\n */\nexport function Component<I extends ComponentInstance = ComponentInstance>(inProps: ComponentProps<I> = {}) {\n const { pIf = true, style, className, as, asChild, instance, ...props } = inProps;\n\n if (pIf === false) return null;\n\n const AsComponent = (as || instance?.props?.as || React.Fragment) as React.ElementType;\n const renderAsChild = asChild || instance?.props?.asChild;\n const isFragment = AsComponent === React.Fragment;\n\n const { ref = instance?.elementRef, children, attrs: inAttrs, ...restAttrs } = props;\n const attrs = { ...inAttrs, ...restAttrs } as React.HTMLAttributes<HTMLElement> & React.RefAttributes<unknown>;\n // @ts-expect-error: Update resolve to handle attrs correctly\n const content = resolve(children, instance, attrs) as React.ReactNode;\n const styles = resolve(style || instance?.props?.style, instance) as React.CSSProperties | undefined;\n const classNames = resolve(className || instance?.props?.className, instance) as string | undefined;\n\n if (renderAsChild || isFragment) {\n return <React.Fragment>{content}</React.Fragment>;\n } else if (isValidElement(AsComponent)) {\n return resolve(AsComponent, instance);\n } else {\n const asProps = {\n ...attrs,\n style: { ...attrs.style, ...styles },\n className: cn(attrs.className, classNames)\n } as React.HTMLAttributes<HTMLElement>;\n\n const asRef = attrs.ref ?? ref;\n\n return asProps.children ? (\n <AsComponent {...asProps} ref={asRef} />\n ) : (\n <AsComponent {...asProps} ref={asRef}>\n {content}\n </AsComponent>\n );\n }\n}\n\nComponent.displayName = 'PrimeReact.Component';\n","import type { ComponentProps, GlobalComponentProps } from '@primereact/types/core';\nimport { omit } from '@primeuix/utils';\n\nexport const globalProps: GlobalComponentProps = {\n ref: undefined,\n pIf: true,\n style: undefined,\n className: undefined,\n as: undefined,\n asChild: false,\n pt: undefined,\n ptOptions: undefined,\n unstyled: undefined,\n dt: undefined,\n styles: undefined,\n children: undefined\n};\n\nexport const defaultComponentProps: ComponentProps = {\n ...(omit(globalProps, 'pt', 'ptOptions', 'dt', 'styles') as Record<PropertyKey, unknown>),\n instance: undefined,\n attrs: undefined\n};\n","import { useBase } from '@primereact/core/base';\nimport type { InComponentInstance, useBaseOptions, useComponentOptions } from '@primereact/types/core';\nimport * as React from 'react';\nimport { globalProps } from './Component.props';\nimport { useComponentPT } from './useComponentPT';\nimport { useComponentStyle } from './useComponentStyle';\n\n/**\n * A hook for creating a component instance.\n * This hook initializes a component with properties, attributes, and styles, and provides methods for handling pass-through options and styles.\n * It also supports custom setup functions for additional configuration.\n *\n * @param name The name of the component, used for debugging and identification.\n * @param options The options to customize the component instance.\n * @returns The component instance.\n */\nexport function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name: string = 'UnknownComponent', options: useComponentOptions<IProps, DProps, Exposes, Styles> = {}) {\n const defaultProps = React.useMemo(() => ({ ...globalProps, ...options.defaultProps }), [options.defaultProps]);\n const baseInstance = useBase(name, {\n inProps: options.inProps,\n defaultProps,\n setup: options.setup\n } as useBaseOptions<IProps & { id?: string; ref?: React.Ref<unknown> }, typeof defaultProps, Exposes>);\n\n const { ref, props } = baseInstance;\n const $params = React.useMemo(() => {\n return {\n instance: baseInstance,\n props: baseInstance.props,\n attrs: baseInstance.attrs,\n state: baseInstance.state\n };\n }, [baseInstance.props, baseInstance.attrs, baseInstance.state]);\n\n const ptx = useComponentPT(baseInstance, $params);\n const stx = useComponentStyle(baseInstance, props.styles || options.styles, $params);\n\n const instance = React.useMemo<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>(\n () => ({\n ...baseInstance,\n ...ptx,\n ...stx\n }),\n [baseInstance, ptx, stx]\n );\n\n React.useImperativeHandle(ref as React.Ref<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n}\n","import { useMountEffect, useUnmountEffect, useUpdateEffect } from '@primereact/hooks';\nimport type { GlobalComponentProps, Instance, PassThroughOptions, useComponentPTReturnType } from '@primereact/types/core';\nimport { mergeProps } from '@primeuix/utils/mergeprops';\nimport { getKeyValue, isArray, isFunction, isNotEmpty, isString, resolve, toFlatCase } from '@primeuix/utils/object';\nimport * as React from 'react';\n\n/**\n * A hook for managing pass-through options for a component.\n *\n * @param instance The instance of the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the pass-through options.\n */\nexport function useComponentPT<Props extends GlobalComponentProps, IProps, Params>(instance: Instance<Props, IProps>, $params?: Params): useComponentPTReturnType {\n const { id, name, scope, part, props, attrs, $primereact, $attrSelector } = instance || {};\n\n // methods\n const _hook = React.useCallback(\n (hookName: string) => {\n const selfHook = _usePT(_getPT(props.pt, name), getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n const defaultHook = _useDefaultPT(getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n\n selfHook?.();\n defaultHook?.();\n },\n [props.pt, name]\n );\n\n const _mergeProps = React.useCallback(<T extends unknown[], R = Record<PropertyKey, unknown>>(fn: ((...args: T) => R | undefined) | boolean, ...args: T): R => {\n return (isFunction(fn) ? fn(...args) : fn ? mergeProps(...args) : Object.assign({}, ...args)) as R;\n }, []);\n\n const _getPTValue = React.useCallback(\n (obj = {}, key = '', params: Record<string, unknown> = {}, searchInDefaultPT = true) => {\n const searchOut = /./g.test(key) && !!params[key.split('.')[0]];\n // @ts-expect-error - @todo\n const { mergeSections = true, mergeProps: useMergeProps = false } = props?.ptOptions || $primereact.passthrough?.options || {};\n const global = searchInDefaultPT ? (searchOut ? _useGlobalPT(_getPTClassValue, key, params) : _useDefaultPT(_getPTClassValue, key, params)) : undefined;\n const self = searchOut ? undefined : _getPTSelf(obj, _getPTClassValue, key, { ...params, global: global || {} });\n const datasets = _getPTDatasets(key);\n\n return mergeSections || (!mergeSections && self) ? _mergeProps(useMergeProps, global, self, datasets) : { ...self, ...datasets };\n },\n [props.ptOptions, _mergeProps]\n );\n\n const _getPTDatasets = React.useCallback(\n (key = '') => {\n const datasetPrefix = 'data-';\n const isExtended = key === 'root' && isNotEmpty(attrs['data-scope']);\n\n return isExtended\n ? {\n [`${datasetPrefix}extend`]: scope\n }\n : {\n [`${datasetPrefix}scope`]: scope,\n ...(key === 'root' && {\n [`${datasetPrefix}part`]: part,\n [`${datasetPrefix}id`]: $attrSelector\n }),\n [`${datasetPrefix}slot`]: key\n };\n },\n [props.pt, $attrSelector, name]\n );\n\n const _getPTClassValue = React.useCallback((obj: Record<string, unknown> = {}, key = '', params?: Record<string, unknown>) => {\n const value = getKeyValue(obj, key, params);\n\n return isString(value) || isArray(value) ? { className: value } : value;\n }, []);\n\n const _getPT = React.useCallback(<Fn extends (...args: unknown[]) => unknown>(pt?: Record<string, unknown>, key = '', fn?: Fn) => {\n const getValue = (value: unknown, checkSameKey = false) => {\n const computedValue = (fn ? fn(value) : value) as Record<string, unknown>;\n const _key = toFlatCase(key);\n const _cKey = toFlatCase(name!);\n\n return ((checkSameKey ? (_key !== _cKey ? computedValue?.[_key] : undefined) : computedValue?.[_key]) ?? computedValue) as Record<string, unknown>;\n };\n\n return pt && Object.hasOwn(pt, '_usept')\n ? {\n _usept: pt['_usept'],\n originalValue: getValue(pt.originalValue),\n value: getValue(pt.value)\n }\n : getValue(pt, true);\n }, []);\n\n const _usePT = React.useCallback(\n <Fn>(pt: Record<string, unknown>, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n const vfn = (value: unknown) => (fn as (...args: unknown[]) => unknown)(value, key, params);\n\n if (pt && Object.hasOwn(pt, '_usept')) {\n // @ts-expect-error - @todo\n const { mergeSections = true, mergeProps: useMergeProps = false } = (pt['_usept'] || $primereact.passthrough?.options || {}) as PassThroughOptions;\n const originalValue = vfn(pt.originalValue);\n const value = vfn(pt.value);\n\n if (originalValue === undefined && value === undefined) return undefined;\n else if (isString(value)) return value;\n else if (isString(originalValue)) return originalValue;\n\n return mergeSections || (!mergeSections && value) ? _mergeProps(useMergeProps, originalValue, value) : value;\n }\n\n return vfn(pt);\n },\n // @ts-expect-error - @todo\n [$primereact.passthrough?.options, _mergeProps]\n );\n\n // computed values\n // @ts-expect-error - @todo\n const $globalPT = React.useMemo(() => _getPT($primereact?.passthrough?.value, undefined, (value) => resolve(value, instance)), [$primereact?.passthrough?.value]);\n // @ts-expect-error - @todo\n const $defaultPT = React.useMemo(() => _getPT($primereact?.passthrough?.value, undefined, (value) => getKeyValue(value as Record<string, unknown>, name, instance) || resolve(value, instance)), [$primereact?.passthrough?.value]);\n const $attrsPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((result, [key, value]) => {\n const [, slot, ...rest] = key.split('-');\n\n [slot, rest?.join('-')]?.filter(Boolean).reduce((currentObj, nestedKey, index, array) => {\n if (!currentObj[nestedKey]) {\n currentObj[nestedKey] = index === array.length - 1 ? value : {};\n }\n\n return currentObj[nestedKey] as Record<string, unknown>;\n }, result);\n\n return result;\n }, {});\n }, [attrs]);\n const $attrsWithoutPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => !key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((acc, [key, value]) => {\n acc[key] = value;\n\n return acc;\n }, {});\n }, [attrs]);\n\n // helpers\n const _getPTSelf = React.useCallback(\n <Fn>(obj: Record<string, unknown> = {}, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return mergeProps(\n _usePT(_getPT(obj, name), fn, key, params), // Exp; <PRComponent pt={{ [passthrough_key]: { [attribute]: value } }}>\n _usePT($attrsPT, fn, key, params) // Exp; <PRComponent pt:[passthrough_key]:[attribute]={value}> or <PRComponent pt:[passthrough_key]={() =>{value}}>\n );\n },\n [$attrsPT]\n );\n\n const _useGlobalPT = React.useCallback(\n <Fn>(fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return _usePT($globalPT, fn, key, params);\n },\n [$globalPT]\n );\n\n const _useDefaultPT = React.useCallback(\n <Fn>(fn: Fn, key: string, params?: Record<string, unknown>) => {\n return _usePT($defaultPT, fn, key, params);\n },\n [$defaultPT]\n );\n\n // exposed methods\n const ptm = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(props.pt, key, { ...$params, ...params }) as Record<string, unknown>;\n },\n [props.pt, $params]\n );\n\n const ptmi = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n const _attrs = mergeProps($attrsWithoutPT, ptm(key, params)) as Record<string, unknown>;\n\n if (_attrs && Object.hasOwn(_attrs, 'id')) {\n _attrs.id ??= id;\n }\n\n return _attrs as Record<string, unknown>;\n },\n [ptm, id, $attrsWithoutPT]\n );\n\n const ptmo = React.useCallback(\n (obj: Record<string, unknown> = {}, key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(obj, key, { ...$params, ...params }, false) as Record<string, unknown>;\n },\n [$params]\n );\n\n // hooks\n useMountEffect(() => _hook('onMounted'));\n useUpdateEffect(() => _hook('onUpdated'));\n useUnmountEffect(() => _hook('onUnmounted'));\n\n return React.useMemo(\n () => ({\n ptm,\n ptmi,\n ptmo\n }),\n [ptm, ptmi, ptmo]\n );\n}\n","import { StyleRegistry } from '@primereact/core/utils';\nimport type { GlobalComponentProps, Instance, useComponentStyleReturnType } from '@primereact/types/core';\nimport { Theme, ThemeService } from '@primeuix/styled';\nimport { cn, getKeyValue } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponentStyleHandler } from './useComponentStyleHandler';\n\n/**\n * A hook for managing component styles.\n *\n * @param instance The instance of the component.\n * @param styles The styles to apply to the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the component styles.\n */\nexport function useComponentStyle<Props extends GlobalComponentProps, IProps, Styles, Params>(instance: Instance<Props, IProps>, styles?: Styles, $params?: Params): useComponentStyleReturnType {\n const { props = { unstyled: false, dt: undefined }, $primereact, $attrSelector, elementRef } = instance || {};\n const $style = useComponentStyleHandler(styles, elementRef);\n\n // refs\n const scopedStyleRef = React.useRef<HTMLStyleElement | null>(null);\n\n // methods\n const _load = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded('base')) {\n const { css } = $style.baseStyles || {};\n\n $style.load(css, { name: 'base', ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName('base');\n }\n\n _loadThemeStyles();\n }, [$style]);\n\n const _loadStyles = React.useCallback(() => {\n _load();\n _themeChangeListener(_load);\n }, [_load]);\n\n // computed values\n const $isUnstyled = React.useMemo(() => (props.unstyled !== undefined ? props.unstyled : $primereact?.config?.unstyled), [props, $primereact?.config]);\n const $styleOptions = React.useMemo(() => ({ nonce: $primereact?.config?.csp?.nonce }), [$primereact?.config]);\n\n // helpers\n const _loadCoreStyles = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded($style?.name) && $style?.name) {\n const name = $style.name === 'global' ? 'base' : $style.name;\n\n $style.loadCSS({ name, ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName($style.name);\n }\n }, [$style, $styleOptions]);\n\n const _loadThemeStyles = React.useCallback(() => {\n if ($isUnstyled || $primereact?.theme === 'none') return;\n\n // common\n if (!Theme.isStyleNameLoaded('common')) {\n const { primitive, semantic, global, style } = $style?.getCommonTheme?.() || {};\n\n $style.load(primitive?.css, { name: 'primitive-variables', ...$styleOptions });\n $style.load(semantic?.css, { name: 'semantic-variables', ...$styleOptions });\n $style.load(global?.css, { name: 'global-variables', ...$styleOptions });\n $style.load($style.baseStyles?.style, { name: 'global-style', ...$styleOptions }, style, true);\n\n Theme.setLoadedStyleName('common');\n }\n\n // component\n if (!Theme.isStyleNameLoaded($style?.name) && $style?.name) {\n const { css, style } = $style?.getComponentTheme?.() || {};\n\n $style.load(css, { name: `${$style.name}-variables`, ...$styleOptions });\n $style.loadStyle({ name: `${$style.name}-style`, ...$styleOptions }, style);\n\n Theme.setLoadedStyleName($style.name);\n }\n\n // layer order\n if (!Theme.isStyleNameLoaded('layer-order')) {\n const layerOrder = $style?.getLayerOrderThemeCSS?.();\n\n $style.load(layerOrder, { name: 'layer-order', first: true, ...$styleOptions });\n\n Theme.setLoadedStyleName('layer-order');\n }\n }, [$isUnstyled, $style, $styleOptions]);\n\n const _loadScopedThemeStyles = (preset: unknown) => {\n const { css } = $style?.getPresetTheme?.(preset, `[${$attrSelector}]`) || {};\n const scopedStyle = $style?.load(css, { name: `${$attrSelector}-${$style.name}`, ...$styleOptions });\n\n scopedStyleRef.current = scopedStyle as HTMLStyleElement;\n };\n\n /*const _unloadScopedThemeStyles = () => {\n scopedStyleRef.current?.remove();\n };*/\n\n const _themeChangeListener = React.useCallback((callback = () => {}) => {\n //if (!StyleRegistry.isStyleNameLoaded('base')) {\n //StyleRegistry.clearLoadedStyleNames();\n ThemeService.on('theme:change', callback);\n //}\n }, []);\n\n /*const _removeThemeListeners = () => {\n ThemeService.off('theme:change', _loadCoreStyles);\n ThemeService.off('theme:change', _load);\n ThemeService.off('theme:change', _themeScopedListener);\n };*/\n\n // exposed methods\n const cx = React.useCallback(\n (key = '', params = {}) => {\n return !$isUnstyled ? cn(getKeyValue($style.classes as Record<string, string>, key, { ...$params, context: params })) : undefined;\n },\n [$isUnstyled, instance, $style.classes]\n );\n\n const sx = React.useCallback(\n (key = '', when = true, params = {}) => {\n if (when) {\n const self = getKeyValue($style.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n const base = getKeyValue($style.baseStyles?.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n\n return { ...base, ...self };\n }\n\n return undefined;\n },\n [$style.inlineStyles, $style.baseStyles?.inlineStyles, instance]\n );\n\n // effects\n if (!$isUnstyled) {\n // @todo - remove\n //Theme.clearLoadedStyleNames();\n //StyleRegistry.clearLoadedStyleNames();\n _loadCoreStyles();\n _loadStyles();\n _loadScopedThemeStyles(props.dt);\n }\n\n return React.useMemo(\n () => ({\n cx,\n sx,\n isUnstyled: $isUnstyled,\n $style\n }),\n [cx, sx, $isUnstyled, $style]\n );\n}\n","import { ThemeContext } from '@primereact/core/theme';\nimport { useStyle } from '@primereact/core/use-style';\nimport type { StylesOptions, StyleType } from '@primereact/types/styles';\nimport { css as Css, dt, Theme } from '@primeuix/styled';\nimport { isNotEmpty, minifyCSS, resolve, toElement } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for managing component styles.\n *\n * @param styles The styles to apply to the component.\n * @param elementRef A reference to the HTML element.\n * @returns An object containing methods to load and manage styles.\n */\nexport function useComponentStyleHandler<Styles>(styles?: Styles, elementRef?: React.Ref<HTMLElement>) {\n const theme = React.useContext(ThemeContext);\n const [load] = useStyle();\n\n const _load = React.useCallback(\n (css?: string, options?: Record<PropertyKey, unknown>) => {\n return load({ name: options?.name as string | undefined, css, element: toElement(elementRef), options });\n },\n [load, elementRef]\n );\n\n return React.useMemo(() => {\n const handler = {\n name: 'base',\n ...(styles as StylesOptions),\n load(style: StyleType = '', options: Record<PropertyKey, unknown> & { name?: string } = {}, extendedStyle = '', enableThemeTransform = false) {\n const name = options.name || handler.name;\n const resolvedStyle = Css`${style}${extendedStyle}` as string;\n const computedStyle = enableThemeTransform ? Theme.transformCSS(name, resolvedStyle) : resolvedStyle;\n\n return isNotEmpty(computedStyle) ? _load(minifyCSS(computedStyle), { name, ...options }) : {};\n },\n loadCSS(options?: Record<PropertyKey, unknown>) {\n return this.load(this.css, options);\n },\n loadStyle(options?: Record<PropertyKey, unknown>, extendedStyle = '') {\n return this.load(this.style, options, extendedStyle, true);\n },\n getCommonTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getCommon(this.name, params);\n },\n getComponentTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getComponent(this.name, params);\n },\n // @todo: preset type\n getPresetTheme(preset: unknown, selector: string, params?: Record<PropertyKey, unknown>) {\n return Theme.getCustomPreset(this.name, preset, selector, params);\n },\n getLayerOrderThemeCSS() {\n return Theme.getLayerOrderCSS(this.name);\n },\n getStyleSheet(extendedCSS = '', props = {}) {\n if (this.css) {\n // @ts-expect-error: update dt definition in primeuix/styled\n const _css = resolve(this.css, { dt }) as string;\n const _style = minifyCSS(Css`${_css}${extendedCSS}`);\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n return `<style type=\"text/css\" data-primereact-style-id=\"${this.name}\" ${_props}>${_style}</style>`;\n }\n\n return '';\n },\n getCommonThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n return Theme.getCommonStyleSheet(this.name, params, props);\n },\n getThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n const cssArr = [Theme.getStyleSheet(this.name, params, props)];\n\n if (theme) {\n const _name = this.name === 'base' ? 'global-style' : `${this.name}-style`;\n const _css = Css`${resolve(theme, { dt })}` as string;\n const _style = minifyCSS(Theme.transformCSS(this.name, _css));\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n cssArr.push(`<style type=\"text/css\" data-primereact-style-id=\"${_name}\" ${_props}>${_style}</style>`);\n }\n\n return cssArr.join('');\n }\n };\n\n return handler;\n }, [styles, theme, _load]);\n}\n","import type { ComponentInstance, InComponentInstance, useComponentOptions, withComponentOptions } from '@primereact/types/core';\nimport type { BaseComponentProps } from '@primereact/types/shared';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { isObject, shallowEqualProps } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponent } from './useComponent';\n\n/**\n * A higher-order component for enhancing a component with additional features.\n *\n * @template IProps The interface for the component's input properties.\n * @template DProps The interface for the component's default properties.\n * @template Exposes The interface for the properties that the component exposes.\n * @template Styles The styles options for the component.\n * @template CData Additional data to expose on the component.\n *\n * @param options The options for the component.\n * @param options.name The name of the component, used for debugging and identification.\n * @param options.defaultProps The default properties for the component.\n * @param options.styles The styles to apply to the component.\n * @param options.components Additional components to include in the component.\n * @param options.setup A setup function for additional configuration of the component.\n * @param options.render A render function for the component.\n * @returns A React component wrapped with the specified options.\n */\nexport function withComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) {\n type InProps<I extends ComponentInstance, T extends React.ElementType> = BaseComponentProps<I, IProps, unknown, T> & DProps;\n\n const BaseComponent = <I extends ComponentInstance, T extends React.ElementType>(inProps?: InProps<I, T>) => {\n const instance = useComponent(name, { inProps, defaultProps, styles, setup } as useComponentOptions<InProps<I, T>, DProps, Exposes, Styles>);\n\n type RenderedComponentProps = InComponentInstance<typeof instance.props, InProps<I, T>, typeof instance.state, Exposes>;\n\n const RenderedComponent = (render as React.FC<RenderedComponentProps>) ?? (() => null);\n\n return instance.props.pIf ? <RenderedComponent {...(instance as RenderedComponentProps)} /> : null;\n };\n\n const Component = React.memo(BaseComponent, (prevProps, nextProps) => {\n if (!isObject(prevProps) || !isObject(nextProps)) {\n return false;\n }\n\n // Compare shallow equality\n return shallowEqualProps(prevProps, nextProps);\n //return prevProps === nextProps && Object.keys(defaultProps || {}).every((key) => (prevProps as Record<string, unknown>)[key] === (nextProps as Record<string, unknown>)[key]);\n }) as unknown as typeof BaseComponent & CData & React.FC;\n\n Component.displayName = `PrimeReact.${name}`;\n Object.entries(components || {}).forEach(([key, value]) => {\n (Component as Record<string, unknown>)[key] = value;\n });\n\n return Component;\n}\n"],"mappings":"8lBAAA,OAAS,kBAAAA,OAAsB,yBAE/B,OAAS,MAAAC,GAAI,WAAAC,MAAe,kBAC5B,UAAYC,MAAW,QAOhB,SAASC,GAA2DC,EAA6B,CAAC,EAAG,CAV5G,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAWI,IAA0EC,EAAAN,EAAlE,KAAAO,EAAM,GAAM,MAAAC,EAAO,UAAAC,EAAW,GAAAC,EAAI,QAAAC,EAAS,SAAAC,CAXvD,EAW8EN,EAAVO,EAAAC,EAAUR,EAAV,CAAxD,MAAY,QAAO,YAAW,KAAI,UAAS,aAEnD,GAAIC,IAAQ,GAAO,OAAO,KAE1B,IAAMQ,EAAeL,KAAMT,EAAAW,GAAA,YAAAA,EAAU,QAAV,YAAAX,EAAiB,KAAY,WAClDe,EAAgBL,KAAWT,EAAAU,GAAA,YAAAA,EAAU,QAAV,YAAAV,EAAiB,SAC5Ce,EAAaF,IAAsB,WAEsCG,EAAAL,EAAvE,KAAAM,EAAMP,GAAA,YAAAA,EAAU,WAAY,SAAAQ,EAAU,MAAOC,CAnBzD,EAmBmFH,EAAdI,EAAAR,EAAcI,EAAd,CAAzD,MAA4B,WAAU,UACxCK,EAAQC,IAAA,GAAKH,GAAYC,GAEzBG,EAAUC,EAAQN,EAAUR,EAAUW,CAAK,EAC3CI,EAASD,EAAQlB,KAASL,EAAAS,GAAA,YAAAA,EAAU,QAAV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ACA,OAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,EAAiE,CAa7D,IAAMC,EAAkB,OAVyDC,GAA4B,CACzG,IAAMC,EAAWC,GAAaT,EAAM,CAAE,QAAAO,EAAS,aAAAN,EAAc,OAAAC,EAAQ,MAAAE,CAAM,CAAgE,EAIrIM,EAAqBL,GAAA,KAAAA,GAAgD,IAAM,MAEjF,OAAOG,EAAS,MAAM,IAAM,gBAACE,EAAAC,EAAA,GAAuBH,EAAqC,EAAK,IAClG,EAE4C,CAACI,EAAWC,IAChD,CAACC,GAASF,CAAS,GAAK,CAACE,GAASD,CAAS,EACpC,GAIJE,GAAkBH,EAAWC,CAAS,CAEhD,EAED,OAAAP,EAAU,YAAc,cAAcN,CAAI,GAC1C,OAAO,QAAQG,GAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACa,EAAKC,CAAK,IAAM,CACtDX,EAAsCU,CAAG,EAAIC,CAClD,CAAC,EAEMX,CACX","names":["isValidElement","cn","resolve","React","Component","inProps","_b","_c","_e","_f","_g","_a","pIf","style","className","as","asChild","instance","props","__objRest","AsComponent","renderAsChild","isFragment","_d","ref","children","inAttrs","restAttrs","attrs","__spreadValues","content","resolve","styles","classNames","isValidElement","asProps","__spreadProps","cn","asRef","omit","globalProps","defaultComponentProps","__spreadProps","__spreadValues","omit","useBase","React","useMountEffect","useUnmountEffect","useUpdateEffect","mergeProps","getKeyValue","isArray","isFunction","isNotEmpty","isString","resolve","toFlatCase","React","useComponentPT","instance","$params","_a","_b","_c","id","name","scope","part","props","attrs","$primereact","$attrSelector","_hook","hookName","selfHook","_usePT","_getPT","getKeyValue","defaultHook","_useDefaultPT","_mergeProps","fn","args","isFunction","mergeProps","_getPTValue","obj","key","params","searchInDefaultPT","searchOut","mergeSections","useMergeProps","global","_useGlobalPT","_getPTClassValue","self","_getPTSelf","__spreadProps","__spreadValues","datasets","_getPTDatasets","datasetPrefix","isNotEmpty","value","isString","isArray","pt","getValue","checkSameKey","computedValue","_key","toFlatCase","_cKey","vfn","originalValue","$globalPT","resolve","$defaultPT","$attrsPT","result","slot","rest","currentObj","nestedKey","index","array","$attrsWithoutPT","acc","ptm","ptmi","_attrs","ptmo","useMountEffect","useUpdateEffect","useUnmountEffect","StyleRegistry","Theme","ThemeService","cn","getKeyValue","React","ThemeContext","useStyle","Css","dt","Theme","isNotEmpty","minifyCSS","resolve","toElement","React","useComponentStyleHandler","styles","elementRef","theme","ThemeContext","load","useStyle","_load","css","options","toElement","handler","__spreadProps","__spreadValues","style","extendedStyle","enableThemeTransform","name","resolvedStyle","Css","computedStyle","Theme","isNotEmpty","minifyCSS","params","preset","selector","extendedCSS","props","_css","resolve","dt","_style","_props","acc","k","v","cssArr","_name","useComponentStyle","instance","styles","$params","_a","props","$primereact","$attrSelector","elementRef","$style","useComponentStyleHandler","scopedStyleRef","_load","StyleRegistry","css","__spreadValues","$styleOptions","_loadThemeStyles","_loadStyles","_themeChangeListener","$isUnstyled","_b","_loadCoreStyles","name","_c","_d","Theme","primitive","semantic","global","style","layerOrder","_loadScopedThemeStyles","preset","scopedStyle","callback","ThemeService","cx","key","params","cn","getKeyValue","__spreadProps","sx","when","self","base","useComponent","name","options","defaultProps","__spreadValues","globalProps","baseInstance","useBase","ref","props","$params","ptx","useComponentPT","stx","useComponentStyle","instance","isObject","shallowEqualProps","React","withComponent","name","defaultProps","styles","components","setup","render","Component","inProps","instance","useComponent","RenderedComponent","__spreadValues","prevProps","nextProps","isObject","shallowEqualProps","key","value"]}
package/config/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";var h=Object.defineProperty;var f=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var d=(o,e,r)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,a=(o,e)=>{for(var r in e||(e={}))x.call(e,r)&&d(o,r,e[r]);if(f)for(var r of f(e))E.call(e,r)&&d(o,r,e[r]);return o};import{LocaleProvider as A}from"@primereact/core/locale";import{PassThroughProvider as _}from"@primereact/core/passthrough";import{ThemeProvider as S}from"@primereact/core/theme";import{useProps as C}from"@primereact/hooks";import{resolve as v}from"@primeuix/utils";import*as i from"react";import{FilterMatchMode as t}from"@primereact/core/api";var l={csp:{nonce:void 0},defaults:void 0,filterMatchModeOptions:{text:[t.STARTS_WITH,t.CONTAINS,t.NOT_CONTAINS,t.ENDS_WITH,t.EQUALS,t.NOT_EQUALS],numeric:[t.EQUALS,t.NOT_EQUALS,t.LESS_THAN,t.LESS_THAN_OR_EQUAL_TO,t.GREATER_THAN,t.GREATER_THAN_OR_EQUAL_TO],date:[t.DATE_IS,t.DATE_IS_NOT,t.DATE_BEFORE,t.DATE_AFTER]},inputVariant:void 0,locale:"en",pt:void 0,ptOptions:{mergeSections:!0,mergeProps:!1},ripple:!1,theme:void 0,stylesheet:void 0,unstyled:!1,zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100}};var m=i.createContext(void 0);function w(o={}){var c,u;let{props:e,attrs:r}=C(o,l),[s,P]=i.useState(e.inputVariant),[R,T]=i.useState(e.defaults),p={inputVariant:s,setInputVariant:P,defaults:R,setDefaults:T};return i.createElement(m.Provider,{value:p},i.createElement(A,{lang:e.locale},i.createElement(_,a({value:e.pt},e.ptOptions),i.createElement(S,a({preset:(c=e.theme)==null?void 0:c.preset,stylesheet:e.stylesheet},(u=e.theme)==null?void 0:u.options),v(r.children,p)))))}import{LocaleContext as O}from"@primereact/core/locale";import{PassThroughContext as N}from"@primereact/core/passthrough";import{ThemeContext as L}from"@primereact/core/theme";import*as n from"react";function j(){let o=n.useContext(m),e=n.useContext(O),r=n.useContext(N),s=n.useContext(L);if(o===void 0)throw new Error("Context must be used within a PrimeReactProvider");return{config:o,locale:e,passthrough:r,theme:s}}export{m as PrimeReactContext,w as PrimeReactProvider,l as defaultConfigProps,j as usePrimeReact};
1
+ var E=Object.defineProperty;var d=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var f=(o,e,r)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,a=(o,e)=>{for(var r in e||(e={}))A.call(e,r)&&f(o,r,e[r]);if(d)for(var r of d(e))_.call(e,r)&&f(o,r,e[r]);return o};import{LocaleProvider as S}from"@primereact/core/locale";import{PassThroughProvider as C}from"@primereact/core/passthrough";import{ThemeProvider as v}from"@primereact/core/theme";import{useProps as O}from"@primereact/hooks";import{resolve as N}from"@primeuix/utils";import*as n from"react";import{FilterMatchMode as t}from"@primereact/core/api";var l={csp:{nonce:void 0},defaults:void 0,filterMatchModeOptions:{text:[t.STARTS_WITH,t.CONTAINS,t.NOT_CONTAINS,t.ENDS_WITH,t.EQUALS,t.NOT_EQUALS],numeric:[t.EQUALS,t.NOT_EQUALS,t.LESS_THAN,t.LESS_THAN_OR_EQUAL_TO,t.GREATER_THAN,t.GREATER_THAN_OR_EQUAL_TO],date:[t.DATE_IS,t.DATE_IS_NOT,t.DATE_BEFORE,t.DATE_AFTER]},inputVariant:void 0,locale:"en",pt:void 0,ptOptions:{mergeSections:!0,mergeProps:!1},ripple:!1,theme:void 0,stylesheet:void 0,unstyled:!1,zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100}};var m=n.createContext(void 0);function F(o={}){var c,u;let{props:e,attrs:r}=O(l,o),[s,P]=n.useState(e.inputVariant),[R,T]=n.useState(e.defaults),[h,x]=n.useState(e.zIndex),p={inputVariant:s,setInputVariant:P,defaults:R,setDefaults:T,zIndex:h,setZIndex:x};return n.createElement(m.Provider,{value:p},n.createElement(S,{lang:e.locale},n.createElement(C,a({value:e.pt},e.ptOptions),n.createElement(v,a({preset:(c=e.theme)==null?void 0:c.preset,stylesheet:e.stylesheet},(u=e.theme)==null?void 0:u.options),N(r.children,p)))))}import{LocaleContext as I}from"@primereact/core/locale";import{PassThroughContext as L}from"@primereact/core/passthrough";import{ThemeContext as g}from"@primereact/core/theme";import*as i from"react";function k(){let o=i.useContext(m),e=i.useContext(I),r=i.useContext(L),s=i.useContext(g);if(o===void 0)throw new Error("Context must be used within a PrimeReactProvider");return{config:o,locale:e,passthrough:r,theme:s}}export{m as PrimeReactContext,F as PrimeReactProvider,l as defaultConfigProps,k as usePrimeReact};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/PrimeReact.context.tsx","../../src/config/PrimeReact.props.ts","../../src/config/usePrimeReact.ts"],"sourcesContent":["import { LocaleProvider } from '@primereact/core/locale';\nimport { PassThroughProvider } from '@primereact/core/passthrough';\nimport { ThemeProvider } from '@primereact/core/theme';\nimport { useProps } from '@primereact/hooks';\nimport type { PrimeReactProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultConfigProps } from './PrimeReact.props';\n\nexport const PrimeReactContext = React.createContext<PrimeReactProps | undefined>(undefined);\n\nexport function PrimeReactProvider(inProps: React.PropsWithChildren<PrimeReactProps> = {}) {\n const { props, attrs } = useProps(inProps, defaultConfigProps);\n\n // states\n const [inputVariant, setInputVariant] = React.useState(props.inputVariant);\n const [defaults, setDefaults] = React.useState(props.defaults);\n\n const value = {\n inputVariant,\n setInputVariant,\n defaults,\n setDefaults\n };\n\n return (\n <PrimeReactContext.Provider value={value}>\n <LocaleProvider lang={props.locale}>\n <PassThroughProvider value={props.pt} {...props.ptOptions}>\n <ThemeProvider preset={props.theme?.preset} stylesheet={props.stylesheet} {...props.theme?.options}>\n {resolve(attrs.children, value)}\n </ThemeProvider>\n </PassThroughProvider>\n </LocaleProvider>\n </PrimeReactContext.Provider>\n );\n}\n","import { FilterMatchMode } from '@primereact/core/api';\nimport type { PrimeReactProps } from '@primereact/types/core';\n\nexport const defaultConfigProps: PrimeReactProps = {\n csp: { nonce: undefined },\n defaults: undefined,\n filterMatchModeOptions: {\n text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],\n numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],\n date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]\n },\n inputVariant: undefined,\n locale: 'en',\n pt: undefined,\n ptOptions: { mergeSections: true, mergeProps: false },\n ripple: false,\n theme: undefined,\n stylesheet: undefined,\n unstyled: false,\n zIndex: { modal: 1100, overlay: 1000, menu: 1000, tooltip: 1100 }\n};\n","import { LocaleContext } from '@primereact/core/locale';\nimport { PassThroughContext } from '@primereact/core/passthrough';\nimport { ThemeContext } from '@primereact/core/theme';\nimport * as React from 'react';\nimport { PrimeReactContext } from './PrimeReact.context';\n\nexport function usePrimeReact() {\n const config = React.useContext(PrimeReactContext);\n const locale = React.useContext(LocaleContext);\n const passthrough = React.useContext(PassThroughContext);\n const theme = React.useContext(ThemeContext);\n\n if (config === undefined) {\n throw new Error('Context must be used within a PrimeReactProvider');\n }\n\n return {\n config,\n locale,\n passthrough,\n theme\n };\n}\n"],"mappings":"sWAAA,OAAS,kBAAAA,MAAsB,0BAC/B,OAAS,uBAAAC,MAA2B,+BACpC,OAAS,iBAAAC,MAAqB,yBAC9B,OAAS,YAAAC,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCNvB,OAAS,mBAAAC,MAAuB,uBAGzB,IAAMC,EAAsC,CAC/C,IAAK,CAAE,MAAO,MAAU,EACxB,SAAU,OACV,uBAAwB,CACpB,KAAM,CAACD,EAAgB,YAAaA,EAAgB,SAAUA,EAAgB,aAAcA,EAAgB,UAAWA,EAAgB,OAAQA,EAAgB,UAAU,EACzK,QAAS,CAAC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e,aAAWC,CAAa,EACvCC,EAAoB,aAAWC,CAAkB,EACjDC,EAAc,aAAWC,CAAY,EAE3C,GAAIP,IAAW,OACX,MAAM,IAAI,MAAM,kDAAkD,EAGtE,MAAO,CACH,OAAAA,EACA,OAAAE,EACA,YAAAE,EACA,MAAAE,CACJ,CACJ","names":["LocaleProvider","PassThroughProvider","ThemeProvider","useProps","resolve","React","FilterMatchMode","defaultConfigProps","PrimeReactContext","PrimeReactProvider","inProps","_a","_b","props","attrs","useProps","defaultConfigProps","inputVariant","setInputVariant","defaults","setDefaults","value","LocaleProvider","PassThroughProvider","__spreadValues","ThemeProvider","resolve","LocaleContext","PassThroughContext","ThemeContext","React","usePrimeReact","config","PrimeReactContext","locale","LocaleContext","passthrough","PassThroughContext","theme","ThemeContext"]}
1
+ {"version":3,"sources":["../../src/config/PrimeReact.context.tsx","../../src/config/PrimeReact.props.ts","../../src/config/usePrimeReact.ts"],"sourcesContent":["'use client';\nimport { LocaleProvider } from '@primereact/core/locale';\nimport { PassThroughProvider } from '@primereact/core/passthrough';\nimport { ThemeProvider } from '@primereact/core/theme';\nimport { useProps } from '@primereact/hooks';\nimport type { PrimeReactProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultConfigProps } from './PrimeReact.props';\n\nexport const PrimeReactContext = React.createContext<PrimeReactProps | undefined>(undefined);\n\nexport function PrimeReactProvider(inProps: React.PropsWithChildren<PrimeReactProps> = {}) {\n const { props, attrs } = useProps(defaultConfigProps, inProps);\n\n // states\n const [inputVariant, setInputVariant] = React.useState(props.inputVariant);\n const [defaults, setDefaults] = React.useState(props.defaults);\n const [zIndex, setZIndex] = React.useState(props.zIndex);\n\n const value = {\n inputVariant,\n setInputVariant,\n defaults,\n setDefaults,\n zIndex,\n setZIndex\n };\n\n return (\n <PrimeReactContext.Provider value={value}>\n <LocaleProvider lang={props.locale}>\n <PassThroughProvider value={props.pt} {...props.ptOptions}>\n <ThemeProvider preset={props.theme?.preset} stylesheet={props.stylesheet} {...props.theme?.options}>\n {resolve(attrs.children, value)}\n </ThemeProvider>\n </PassThroughProvider>\n </LocaleProvider>\n </PrimeReactContext.Provider>\n );\n}\n","import { FilterMatchMode } from '@primereact/core/api';\nimport type { PrimeReactProps } from '@primereact/types/core';\n\nexport const defaultConfigProps: PrimeReactProps = {\n csp: { nonce: undefined },\n defaults: undefined,\n filterMatchModeOptions: {\n text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],\n numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],\n date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]\n },\n inputVariant: undefined,\n locale: 'en',\n pt: undefined,\n ptOptions: { mergeSections: true, mergeProps: false },\n ripple: false,\n theme: undefined,\n stylesheet: undefined,\n unstyled: false,\n zIndex: { modal: 1100, overlay: 1000, menu: 1000, tooltip: 1100 }\n};\n","import { LocaleContext } from '@primereact/core/locale';\nimport { PassThroughContext } from '@primereact/core/passthrough';\nimport { ThemeContext } from '@primereact/core/theme';\nimport * as React from 'react';\nimport { PrimeReactContext } from './PrimeReact.context';\n\nexport function usePrimeReact() {\n const config = React.useContext(PrimeReactContext);\n const locale = React.useContext(LocaleContext);\n const passthrough = React.useContext(PassThroughContext);\n const theme = React.useContext(ThemeContext);\n\n if (config === undefined) {\n throw new Error('Context must be used within a PrimeReactProvider');\n }\n\n return {\n config,\n locale,\n passthrough,\n theme\n };\n}\n"],"mappings":"yVACA,OAAS,kBAAAA,MAAsB,0BAC/B,OAAS,uBAAAC,MAA2B,+BACpC,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AOb,EAAM,IAAQA,EAAM,WAC5C,gBAACc,EAAAD,EAAA,CAAc,QAAQf,EAAAE,EAAM,QAAN,YAAAF,EAAa,OAAQ,WAAYE,EAAM,aAAgBD,EAAAC,EAAM,QAAN,YAAAD,EAAa,SACtFgB,EAAQd,EAAM,SAAUS,CAAK,CAClC,CACJ,CACJ,CACJ,CAER,CExCA,OAAS,iBAAAM,MAAqB,0BAC9B,OAAS,sBAAAC,MAA0B,+BACnC,OAAS,gBAAAC,MAAoB,yBAC7B,UAAYC,MAAW,QAGhB,SAASC,GAAgB,CAC5B,IAAMC,EAAe,aAAWC,CAAiB,EAC3CC,EAAe,aAAWC,CAAa,EACvCC,EAAoB,aAAWC,CAAkB,EACjDC,EAAc,aAAWC,CAAY,EAE3C,GAAIP,IAAW,OACX,MAAM,IAAI,MAAM,kDAAkD,EAGtE,MAAO,CACH,OAAAA,EACA,OAAAE,EACA,YAAAE,EACA,MAAAE,CACJ,CACJ","names":["LocaleProvider","PassThroughProvider","ThemeProvider","useProps","resolve","React","FilterMatchMode","defaultConfigProps","PrimeReactContext","PrimeReactProvider","inProps","_a","_b","props","attrs","useProps","defaultConfigProps","inputVariant","setInputVariant","defaults","setDefaults","zIndex","setZIndex","value","LocaleProvider","PassThroughProvider","__spreadValues","ThemeProvider","resolve","LocaleContext","PassThroughContext","ThemeContext","React","usePrimeReact","config","PrimeReactContext","locale","LocaleContext","passthrough","PassThroughContext","theme","ThemeContext"]}
package/icon/index.mjs CHANGED
@@ -6,6 +6,7 @@
6
6
  width: dt('icon.size');
7
7
  height: dt('icon.size');
8
8
  transform: rotate(dt('icon.rotate'));
9
+ flex-shrink: 0;
9
10
  }
10
11
 
11
12
  .p-icon-flip-horizontal {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/Icon.tsx","../../src/icon/Icon.props.ts","../../src/icon/Icon.style.ts","../../src/icon/withIcon.tsx","../../src/icon/useIcon.ts"],"sourcesContent":["import { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultIconProps } from './Icon.props';\nimport { styles } from './Icon.style';\nimport { withIcon } from './withIcon';\n\nexport const Icon = withIcon({\n name: 'Icon',\n styles,\n defaultProps: defaultIconProps,\n render(instance) {\n const { id, props, ptmi, pti, cx, sx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n style: sx('root'),\n className: cx('root')\n },\n pti?.(),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { IconProps } from '@primereact/types/core';\n\nexport const defaultIconProps: IconProps = {\n as: 'i',\n size: undefined,\n rotate: undefined,\n flip: undefined,\n spin: false\n};\n","import type { StylesOptions } from '@primereact/types/styles';\nimport { $dt } from '@primeuix/styled';\n\nconst css = /*css*/ `\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n font-size: dt('icon.size');\n width: dt('icon.size');\n height: dt('icon.size');\n transform: rotate(dt('icon.rotate'));\n}\n\n.p-icon-flip-horizontal {\n transform: scaleX(-1);\n}\n\n.p-icon-flip-vertical {\n transform: scaleY(-1);\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n`;\n\nexport const styles = {\n name: 'icon',\n css,\n classes: {\n root: ({ props }) => [\n 'p-icon',\n {\n 'p-icon-spin': props.spin,\n 'p-icon-flip-horizontal': props.flip === 'horizontal',\n 'p-icon-flip-vertical': props.flip === 'vertical'\n }\n ]\n },\n inlineStyles: {\n root: ({ props }) => ({\n ...(props.size ? { [$dt('icon.size').name]: props.size } : undefined),\n ...(props.rotate ? { [$dt('icon.rotate').name]: `${props.rotate}deg` } : undefined)\n })\n }\n} as StylesOptions;\n","import { withComponent } from '@primereact/core/component';\nimport type { BaseSetup, IconExposes, withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useIcon } from './useIcon';\n\n/**\n * Higher-order component for enhancing icon components.\n *\n * @template IProps - The interface for the icon component's props.\n * @template DProps - The interface for the default properties of the icon component.\n * @template Exposes - The interface for the properties exposed by the icon component.\n * @template Styles - The styles options for the icon component.\n * @template CData - The context data for the icon component.\n *\n * @param options - The options for the icon component.\n * @param options.name - The name of the icon component.\n * @param options.defaultProps - The default properties for the icon component.\n * @param options.styles - The styles options for the icon component.\n * @param options.components - The components to be used within the icon component.\n * @param options.setup - The setup function for the icon component.\n * @param options.render - The render function for the icon component.\n * @returns A React component wrapped with the specified options.\n */\nexport function withIcon<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes & IconExposes, Styles, CData>) {\n return withComponent<IProps, DProps, Exposes & IconExposes, Styles, CData>({\n name: `${name ?? 'Unknown'}Icon`,\n defaultProps,\n styles,\n components,\n setup(instance) {\n const icon = useIcon(instance?.inProps);\n const computedSetup = resolve(setup as BaseSetup<typeof instance.props, IProps, Exposes>, instance) as Exposes;\n\n return React.useMemo(\n () => ({\n ...icon,\n ...computedSetup\n }),\n [icon, computedSetup]\n );\n },\n render\n });\n}\n","import { withHeadless } from '@primereact/core/headless';\nimport { isEmpty } from '@primeuix/utils';\n\nexport const useIcon = withHeadless({\n name: 'useIcon',\n setup({ attrs }) {\n const pti = () => {\n const isAriaLabelEmpty = isEmpty(attrs['aria-label']);\n\n return {\n role: !isAriaLabelEmpty ? 'img' : undefined,\n 'aria-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AM,CACd,IAAMC,EAAmBH,EAAQE,EAAM,YAAY,CAAC,EAEpD,MAAO,CACH,KAAOC,EAA2B,OAAR,MAC1B,cAAeH,EAAQE,EAAM,QAAQ,GAAKC,CAC9C,CACJ,CAIA,CACJ,CACJ,CAAC,EDMM,SAASC,EAA+J,CAC3K,KAAAC,EACA,aAAAC,EACA,OAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,EAA+E,CAC3E,OAAOC,EAAoE,CACvE,KAAM,GAAGN,GAAA,KAAAA,EAAQ,SAAS,OAC1B,aAAAC,EACA,OAAAC,EACA,WAAAC,EACA,MAAMI,EAAU,CACZ,IAAMC,EAAOC,EAAQF,GAAA,YAAAA,EAAU,OAAO,EAChCG,EAAgBC,EAAQP,EAA4DG,CAAQ,EAElG,OAAa,UACT,IAAOK,IAAA,GACAJ,GACAE,GAEP,CAACF,EAAME,CAAa,CACxB,CACJ,EACA,OAAAL,CACJ,CAAC,CACL,CH7CO,IAAMQ,EAAOC,EAAS,CACzB,KAAM,OACN,OAAAC,EACA,aAAcC,EACd,OAAOC,EAAU,CACb,GAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,KAAAC,EAAM,IAAAC,EAAK,GAAAC,EAAI,GAAAC,CAAG,EAAIN,EAEnCO,EAAYC,EACd,CACI,GAAAP,EACA,MAAOK,EAAG,MAAM,EAChB,UAAWD,EAAG,MAAM,CACxB,EACAD,GAAA,YAAAA,IACAD,EAAK,MAAM,CACf,EAEA,OAAO,gBAACM,EAAA,CAAU,SAAUT,EAAU,MAAOO,EAAW,SAAUL,EAAM,SAAU,CACtF,CACJ,CAAC","names":["Component","mergeProps","React","defaultIconProps","$dt","css","styles","props","__spreadValues","$dt","withComponent","resolve","React","withHeadless","isEmpty","useIcon","attrs","isAriaLabelEmpty","withIcon","name","defaultProps","styles","components","setup","render","withComponent","instance","icon","useIcon","computedSetup","resolve","__spreadValues","Icon","withIcon","styles","defaultIconProps","instance","id","props","ptmi","pti","cx","sx","rootProps","mergeProps","Component"]}
1
+ {"version":3,"sources":["../../src/icon/Icon.tsx","../../src/icon/Icon.props.ts","../../src/icon/Icon.style.ts","../../src/icon/withIcon.tsx","../../src/icon/useIcon.ts"],"sourcesContent":["import { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultIconProps } from './Icon.props';\nimport { styles } from './Icon.style';\nimport { withIcon } from './withIcon';\n\nexport const Icon = withIcon({\n name: 'Icon',\n styles,\n defaultProps: defaultIconProps,\n render(instance) {\n const { id, props, ptmi, pti, cx, sx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n style: sx('root'),\n className: cx('root')\n },\n pti?.(),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { IconProps } from '@primereact/types/core';\n\nexport const defaultIconProps: IconProps = {\n as: 'i',\n size: undefined,\n rotate: undefined,\n flip: undefined,\n spin: false\n};\n","import type { StylesOptions } from '@primereact/types/styles';\nimport { $dt } from '@primeuix/styled';\n\nconst css = /*css*/ `\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n font-size: dt('icon.size');\n width: dt('icon.size');\n height: dt('icon.size');\n transform: rotate(dt('icon.rotate'));\n flex-shrink: 0;\n}\n\n.p-icon-flip-horizontal {\n transform: scaleX(-1);\n}\n\n.p-icon-flip-vertical {\n transform: scaleY(-1);\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n`;\n\nexport const styles = {\n name: 'icon',\n css,\n classes: {\n root: ({ props }) => [\n 'p-icon',\n {\n 'p-icon-spin': props.spin,\n 'p-icon-flip-horizontal': props.flip === 'horizontal',\n 'p-icon-flip-vertical': props.flip === 'vertical'\n }\n ]\n },\n inlineStyles: {\n root: ({ props }) => ({\n ...(props.size ? { [$dt('icon.size').name]: props.size } : undefined),\n ...(props.rotate ? { [$dt('icon.rotate').name]: `${props.rotate}deg` } : undefined)\n })\n }\n} as StylesOptions;\n","import { withComponent } from '@primereact/core/component';\nimport type { BaseSetup, IconExposes, withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useIcon } from './useIcon';\n\n/**\n * Higher-order component for enhancing icon components.\n *\n * @template IProps - The interface for the icon component's props.\n * @template DProps - The interface for the default properties of the icon component.\n * @template Exposes - The interface for the properties exposed by the icon component.\n * @template Styles - The styles options for the icon component.\n * @template CData - The context data for the icon component.\n *\n * @param options - The options for the icon component.\n * @param options.name - The name of the icon component.\n * @param options.defaultProps - The default properties for the icon component.\n * @param options.styles - The styles options for the icon component.\n * @param options.components - The components to be used within the icon component.\n * @param options.setup - The setup function for the icon component.\n * @param options.render - The render function for the icon component.\n * @returns A React component wrapped with the specified options.\n */\nexport function withIcon<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes & IconExposes, Styles, CData>) {\n return withComponent<IProps, DProps, Exposes & IconExposes, Styles, CData>({\n name: `${name ?? 'Unknown'}Icon`,\n defaultProps,\n styles,\n components,\n setup(instance) {\n const icon = useIcon(instance?.inProps);\n const computedSetup = resolve(setup as BaseSetup<typeof instance.props, IProps, Exposes>, instance) as Exposes;\n\n return React.useMemo(\n () => ({\n ...icon,\n ...computedSetup\n }),\n [icon, computedSetup]\n );\n },\n render\n });\n}\n","import { withHeadless } from '@primereact/core/headless';\nimport { isEmpty } from '@primeuix/utils';\n\nexport const useIcon = withHeadless({\n name: 'useIcon',\n setup({ attrs }) {\n const pti = () => {\n const isAriaLabelEmpty = isEmpty(attrs['aria-label']);\n\n return {\n role: !isAriaLabelEmpty ? 'img' : undefined,\n 'aria-hidden': isEmpty(attrs.tabIndex) && isAriaLabelEmpty\n };\n };\n\n return {\n pti\n };\n }\n});\n"],"mappings":"sWAAA,OAAS,aAAAA,MAAiB,6BAC1B,OAAS,cAAAC,MAAkB,kBAC3B,UAAYC,MAAW,QCAhB,IAAMC,EAA8B,CACvC,GAAI,IACJ,KAAM,OACN,OAAQ,OACR,KAAM,OACN,KAAM,EACV,ECPA,OAAS,OAAAC,MAAW,mBAEpB,IAAMC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA+CPC,EAAS,CAClB,KAAM,OACN,IAAAD,EACA,QAAS,CACL,KAAM,CAAC,CAAE,MAAAE,CAAM,IAAM,CACjB,SACA,CACI,cAAeA,EAAM,KACrB,yBAA0BA,EAAM,OAAS,aACzC,uBAAwBA,EAAM,OAAS,UAC3C,CACJ,CACJ,EACA,aAAc,CACV,KAAM,CAAC,CAAE,MAAAA,CAAM,IAAOC,IAAA,GACdD,EAAM,KAAO,CAAE,CAACE,EAAI,WAAW,EAAE,IAAI,EAAGF,EAAM,IAAK,EAAI,QACvDA,EAAM,OAAS,CAAE,CAACE,EAAI,aAAa,EAAE,IAAI,EAAG,GAAGF,EAAM,MAAM,KAAM,EAAI,OAEjF,CACJ,ECrEA,OAAS,iBAAAG,MAAqB,6BAG9B,OAAS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dt","css","styles","props","__spreadValues","$dt","withComponent","resolve","React","withHeadless","isEmpty","useIcon","attrs","isAriaLabelEmpty","withIcon","name","defaultProps","styles","components","setup","render","withComponent","instance","icon","useIcon","computedSetup","resolve","__spreadValues","Icon","withIcon","styles","defaultIconProps","instance","id","props","ptmi","pti","cx","sx","rootProps","mergeProps","Component"]}
package/locale/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{useProps as p}from"@primereact/hooks";import{resolve as s}from"@primeuix/utils";import*as o from"react";var c={lang:"en"};var r=o.createContext(void 0),d=(e={})=>{let{attrs:n}=p(e,c),t=void 0;return o.createElement(r.Provider,{value:t},s(n.children,t))};import*as a from"react";function L(){let e=a.useContext(r);if(e===void 0)throw new Error("Context must be used within a LocaleProvider");return e}export{r as LocaleContext,d as LocaleProvider,c as defaultLocaleProps,L as useLocale};
1
+ import{useProps as p}from"@primereact/hooks";import{resolve as s}from"@primeuix/utils";import*as o from"react";var c={lang:"en"};var r=o.createContext(void 0),d=(e={})=>{let{attrs:n}=p(c,e),t=void 0;return o.createElement(r.Provider,{value:t},s(n.children,t))};import*as a from"react";function L(){let e=a.useContext(r);if(e===void 0)throw new Error("Context must be used within a LocaleProvider");return e}export{r as LocaleContext,d as LocaleProvider,c as defaultLocaleProps,L as useLocale};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/locale/Locale.context.tsx","../../src/locale/Locale.props.ts","../../src/locale/useLocale.ts"],"sourcesContent":["import { useProps } from '@primereact/hooks';\nimport type { LocaleProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultLocaleProps } from './Locale.props';\n\nexport const LocaleContext = React.createContext<LocaleProps | undefined>(undefined);\n\nexport const LocaleProvider = (inProps: React.PropsWithChildren<LocaleProps> = {}) => {\n const { attrs } = useProps(inProps, defaultLocaleProps as LocaleProps);\n const value = undefined;\n\n return <LocaleContext.Provider value={value}>{resolve(attrs.children, value)}</LocaleContext.Provider>;\n};\n","import type { LocaleProps } from '@primereact/types/core';\n\nexport const defaultLocaleProps: LocaleProps = {\n lang: 'en'\n};\n","import * as React from 'react';\nimport { LocaleContext } from './Locale.context';\n\nexport function useLocale() {\n const context = React.useContext(LocaleContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a LocaleProvider');\n }\n\n return context;\n}\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCDhB,IAAMC,EAAkC,CAC3C,KAAM,IACV,EDEO,IAAMC,EAAsB,gBAAuC,MAAS,EAEtEC,EAAiB,CAACC,EAAgD,CAAC,IAAM,CAClF,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASF,EAASG,CAAiC,EAC/DC,EAAQ,OAEd,OAAO,gBAACN,EAAc,SAAd,CAAuB,MAAOM,GAAQC,EAAQJ,EAAM,SAAUG,CAAK,CAAE,CACjF,EEbA,UAAYE,MAAW,QAGhB,SAASC,GAAY,CACxB,IAAMC,EAAgB,aAAWC,CAAa,EAE9C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,8CAA8C,EAGlE,OAAOA,CACX","names":["useProps","resolve","React","defaultLocaleProps","LocaleContext","LocaleProvider","inProps","attrs","useProps","defaultLocaleProps","value","resolve","React","useLocale","context","LocaleContext"]}
1
+ {"version":3,"sources":["../../src/locale/Locale.context.tsx","../../src/locale/Locale.props.ts","../../src/locale/useLocale.ts"],"sourcesContent":["'use client';\nimport { useProps } from '@primereact/hooks';\nimport type { LocaleProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultLocaleProps } from './Locale.props';\n\nexport const LocaleContext = React.createContext<LocaleProps | undefined>(undefined);\n\nexport const LocaleProvider = (inProps: React.PropsWithChildren<LocaleProps> = {}) => {\n const { attrs } = useProps(defaultLocaleProps as LocaleProps, inProps);\n const value = undefined;\n\n return <LocaleContext.Provider value={value}>{resolve(attrs.children, value)}</LocaleContext.Provider>;\n};\n","import type { LocaleProps } from '@primereact/types/core';\n\nexport const defaultLocaleProps: LocaleProps = {\n lang: 'en'\n};\n","import * as React from 'react';\nimport { LocaleContext } from './Locale.context';\n\nexport function useLocale() {\n const context = React.useContext(LocaleContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a LocaleProvider');\n }\n\n return context;\n}\n"],"mappings":"AACA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCFhB,IAAMC,EAAkC,CAC3C,KAAM,IACV,EDGO,IAAMC,EAAsB,gBAAuC,MAAS,EAEtEC,EAAiB,CAACC,EAAgD,CAAC,IAAM,CAClF,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASC,EAAmCH,CAAO,EAC/DI,EAAQ,OAEd,OAAO,gBAACN,EAAc,SAAd,CAAuB,MAAOM,GAAQC,EAAQJ,EAAM,SAAUG,CAAK,CAAE,CACjF,EEdA,UAAYE,MAAW,QAGhB,SAASC,GAAY,CACxB,IAAMC,EAAgB,aAAWC,CAAa,EAE9C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,8CAA8C,EAGlE,OAAOA,CACX","names":["useProps","resolve","React","defaultLocaleProps","LocaleContext","LocaleProvider","inProps","attrs","useProps","defaultLocaleProps","value","resolve","React","useLocale","context","LocaleContext"]}
@@ -3,7 +3,6 @@ import { MotionInstance, MotionProps, useMotionProps } from '@primereact/types/s
3
3
  import * as _primereact_types_shared from '@primereact/types/shared';
4
4
  import * as _primereact_types_core from '@primereact/types/core';
5
5
  import * as React$1 from 'react';
6
- import { MotionInstance as MotionInstance$1 } from '@primeuix/motion';
7
6
 
8
7
  declare const Motion: (<I extends _primereact_types_core.ComponentInstance, T extends React$1.ElementType>(inProps?: (_primereact_types_core.GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<_primereact_types_shared.ExtractProps<T>, keyof _primereact_types_core.GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & _primereact_types_shared_motion.MotionProps) | undefined) => React$1.JSX.Element | null) & Record<string, unknown> & React$1.FC<{}>;
9
8
 
@@ -16,11 +15,13 @@ declare const useMotionContext: () => MotionInstance | undefined;
16
15
  declare const defaultMotionProps: MotionProps;
17
16
 
18
17
  declare const useMotion: (inProps?: unknown) => _primereact_types_core.HeadlessInstance<useMotionProps, unknown, {
19
- motionRef: React$1.RefObject<MotionInstance$1 | null>;
18
+ state: {
19
+ rendered: boolean;
20
+ };
20
21
  enter: () => Promise<void | (() => void)> | undefined;
21
22
  leave: () => Promise<void | (() => void)> | undefined;
22
23
  cancel: () => void | undefined;
23
- update: (element: Element, motionProps?: useMotionProps) => void;
24
+ update: (element: Element | null, motionProps?: useMotionProps) => void;
24
25
  }>;
25
26
 
26
27
  declare const defaultUseMotionProps: useMotionProps;
package/motion/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";var I=Object.defineProperty,L=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var h=(a,e,t)=>e in a?I(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,f=(a,e)=>{for(var t in e||(e={}))S.call(e,t)&&h(a,t,e[t]);if(x)for(var t of x(e))A.call(e,t)&&h(a,t,e[t]);return a},p=(a,e)=>L(a,k(e));import{Component as H}from"@primereact/core/component";import{nextFrame as B}from"@primeuix/motion";import{mergeProps as K}from"@primeuix/utils";import{withComponent as b}from"@primereact/core/component";import{styles as D}from"@primereact/styles/base";var E=({name:a="UnknownComponent",defaultProps:e,styles:t=p(f({},D),{name:"global"}),components:i,setup:u,render:r})=>b({name:a,defaultProps:e,styles:t,components:i,setup:u,render:r});import*as o from"react";import{createOptionalContext as F}from"@primereact/core/utils";var[N,V]=F();var y={name:void 0,type:void 0,safe:!1,appear:!1,enter:!0,leave:!0,duration:void 0,enterFromClassName:void 0,enterToClassName:void 0,enterActiveClassName:void 0,leaveFromClassName:void 0,leaveToClassName:void 0,leaveActiveClassName:void 0,onBeforeEnter:void 0,onEnter:void 0,onAfterEnter:void 0,onEnterCancelled:void 0,onBeforeLeave:void 0,onLeave:void 0,onAfterLeave:void 0,onLeaveCancelled:void 0};var O=p(f({},y),{as:"div",in:!1,mountOnEnter:!0,unmountOnLeave:!0});import{withHeadless as U}from"@primereact/core/headless";import{createMotion as g}from"@primeuix/motion";import*as l from"react";var w=U({name:"useMotion",defaultProps:y,setup({props:a,elementRef:e}){let t=l.useRef(null),i=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.enter()},[t.current]),u=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.leave()},[t.current]),r=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.cancel()},[t.current]),c=l.useCallback((s,n)=>{var m;let d=p(f({},n),{name:n==null?void 0:n.name,enterClass:{from:n==null?void 0:n.enterFromClassName,to:n==null?void 0:n.enterToClassName,active:n==null?void 0:n.enterActiveClassName},leaveClass:{from:n==null?void 0:n.leaveFromClassName,to:n==null?void 0:n.leaveToClassName,active:n==null?void 0:n.leaveActiveClassName}});t.current?(m=t.current)==null||m.update(s,d):t.current=g(s,d)},[t.current]);return l.useLayoutEffect(()=>{e.current&&c(e.current,a)},[]),{motionRef:t,enter:i,leave:u,cancel:r,update:c}}});var ce=E({name:"Motion",defaultProps:O,setup(a){let{props:e}=a,[t,i]=o.useState(()=>e.in||!e.mountOnEnter),u=o.useRef(!0),r=w(e);return o.useEffect(()=>{e.in&&!t&&i(!0)},[e.in]),o.useLayoutEffect(()=>{var d,m,C,M,v;let c=(d=r==null?void 0:r.elementRef)==null?void 0:d.current;if(!c||!t){u.current=!1;return}let s=!1,n=u.current&&e.in&&e.appear;return c.style.display="",(m=r.update)==null||m.call(r,c,e),e.in?(n||!u.current)&&((C=r.enter)==null||C.call(r)):(v=(M=r.leave)==null?void 0:M.call(r))==null||v.then(()=>{!c||s||e.in||(e.unmountOnLeave?(c.style.display="none",B().then(()=>{s||i(!1)})):c.style.display="none")}),u.current=!1,()=>{var R;s=!0,(R=r.cancel)==null||R.call(r)}},[e.in,t,e.unmountOnLeave,e.appear]),o.useEffect(()=>()=>{u.current=!0},[]),p(f({},r),{rendered:t})},render(a){let{id:e,props:t,ptmi:i,rendered:u}=a,r=K({id:e},i("root"));return o.createElement(N,{value:a},o.createElement(H,{pIf:u,instance:a,attrs:r,children:t.children}))}});export{ce as Motion,N as MotionProvider,O as defaultMotionProps,y as defaultUseMotionProps,w as useMotion,V as useMotionContext};
1
+ var N=Object.defineProperty,k=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var g=(e,i,t)=>i in e?N(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,p=(e,i)=>{for(var t in i||(i={}))T.call(i,t)&&g(e,t,i[t]);if(H)for(var t of H(i))A.call(i,t)&&g(e,t,i[t]);return e},v=(e,i)=>k(e,O(i));import{Component as j,withComponent as W}from"@primereact/core/component";import{mergeProps as q}from"@primeuix/utils";import*as E from"react";import{createOptionalContext as I}from"@primereact/core/utils";var[L,G]=I();var M={elementRef:void 0,visible:!1,mountOnEnter:!0,unmountOnLeave:!0,name:void 0,type:void 0,safe:!1,disabled:!1,appear:!1,enter:!0,leave:!0,duration:void 0,hideStrategy:"display",enterFromClassName:void 0,enterToClassName:void 0,enterActiveClassName:void 0,leaveFromClassName:void 0,leaveToClassName:void 0,leaveActiveClassName:void 0,onBeforeEnter:void 0,onEnter:void 0,onAfterEnter:void 0,onEnterCancelled:void 0,onBeforeLeave:void 0,onLeave:void 0,onAfterLeave:void 0,onLeaveCancelled:void 0};var P=v(p({},M),{as:"div"});import{withHeadless as F}from"@primereact/core/headless";import{createMotion as U}from"@primeuix/motion";import{nextFrame as B}from"@primeuix/utils";import*as r from"react";var b=new WeakMap;function x(e,i){if(e)switch(b.has(e)||b.set(e,{display:e.style.display,visibility:e.style.visibility,maxHeight:e.style.maxHeight}),i){case"display":e.style.display="none";break;case"visibility":e.style.visibility="hidden",e.style.maxHeight="0";break}}function R(e,i){var a;if(!e)return;let t=(a=b.get(e))!=null?a:e.style;switch(i){case"display":e.style.display=(t==null?void 0:t.display)||"";break;case"visibility":e.style.visibility=(t==null?void 0:t.visibility)||"",e.style.maxHeight=(t==null?void 0:t.maxHeight)||"";break}b.delete(e)}var S=F({name:"useMotion",defaultProps:M,setup({props:e,elementRef:i}){let[t,a]=r.useState(()=>e.visible&&e.mountOnEnter||!e.mountOnEnter),h={rendered:t},o=r.useRef(void 0),u=r.useRef(!0),C=r.useCallback(()=>{var n;return((n=e.elementRef)==null?void 0:n.current)||(i==null?void 0:i.current)},[e.elementRef,i]),c=r.useCallback(()=>{var n;return(n=o.current)==null?void 0:n.enter()},[o.current]),f=r.useCallback(()=>{var n;return(n=o.current)==null?void 0:n.leave()},[o.current]),m=r.useCallback(()=>{var n;return(n=o.current)==null?void 0:n.cancel()},[o.current]),l=r.useCallback((n,s={})=>{var d;if(!n)return;let y=v(p({},s),{appear:!0,enterClass:{from:s.enterFromClassName,to:s.enterToClassName,active:s.enterActiveClassName},leaveClass:{from:s.leaveFromClassName,to:s.leaveToClassName,active:s.leaveActiveClassName}});o.current?(d=o.current)==null||d.update(n,y):o.current=U(n,y)},[]);return r.useEffect(()=>()=>{let n=C();R(n,e.hideStrategy),u.current=!0},[]),r.useEffect(()=>{e.visible&&!t&&a(!0)},[e.visible]),r.useLayoutEffect(()=>{let n=C();l==null||l(n,e)},[]),r.useLayoutEffect(()=>{var d;let n=C();if(!n||!t){u.current=!1;return}let s=!1,y=u.current&&e.visible&&e.appear;return R(n,e.hideStrategy),l==null||l(n,e),e.visible?(y||!u.current)&&(c==null||c()):(d=f==null?void 0:f())==null||d.then(()=>{!n||s||e.visible||(e.unmountOnLeave?(x(n,e.hideStrategy),B().then(()=>{s||a(!1)})):x(n,e.hideStrategy))}),u.current=!1,()=>{s=!0,m==null||m()}},[e.visible,t,e.unmountOnLeave,e.appear]),{state:h,enter:c,leave:f,cancel:m,update:l}}});var ae=W({name:"Motion",defaultProps:P,setup(e){return S(e.inProps)},render(e){let{id:i,props:t,state:a,ptmi:h}=e,o=q({id:i},h("root"));return E.createElement(L,{value:e},E.createElement(j,{pIf:a.rendered,instance:e,attrs:o,children:t.children}))}});export{ae as Motion,L as MotionProvider,P as defaultMotionProps,M as defaultUseMotionProps,S as useMotion,G as useMotionContext};
2
2
  //# sourceMappingURL=index.mjs.map