{"version":3,"file":"x.mjs","names":["props: ListXProps<T>","p: ListXProps<T>"],"sources":["../../../src/components/list/x.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FlatListProps } from \"react-native\";\n\nimport * as React from \"react\";\nimport { FlatList } from \"react-native\";\n\nimport { useScrollCore } from \"#/contexts/scrollcore\";\nimport { getComponentProps } from \"#/functions/props\";\nimport { useContentXHandler } from \"#/hooks/content\";\n\n/** Props for the `ListX` component. */\ntype ListXProps<T> = FlatListProps<T> & {\n    ref?: React.Ref<FlatList>;\n};\n\n/**\n * Horizontal list component.\n *\n * Use `ContentX` for generic content.\n */\nconst ListX = <T,>(props: ListXProps<T>): React.JSX.Element => {\n    const {\n        options: { disabled, plugins },\n        x: { contentRef, contentType },\n    } = useScrollCore();\n\n    const p: ListXProps<T> = getComponentProps({\n        name: \"listX\",\n        props,\n        plugins,\n    });\n\n    React.useImperativeHandle(p.ref, (): FlatList => {\n        return contentRef.current as FlatList;\n    }, [\n        contentRef,\n    ]);\n\n    React.useEffect((): void => {\n        contentType.current = \"flatlist\";\n    }, [\n        contentType,\n    ]);\n\n    const { onLayout, onContentSizeChange, onScroll } = useContentXHandler({\n        props: p,\n    });\n\n    return (\n        <FlatList\n            {...p}\n            ref={contentRef}\n            showsHorizontalScrollIndicator={\n                p.showsHorizontalScrollIndicator ?? disabled\n            }\n            showsVerticalScrollIndicator={false}\n            onLayout={onLayout}\n            onContentSizeChange={onContentSizeChange}\n            onScroll={onScroll}\n            horizontal={true}\n            scrollEventThrottle={p.scrollEventThrottle ?? 5}\n        >\n            {p.children}\n        </FlatList>\n    );\n};\n\nexport type { ListXProps };\nexport { ListX };\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,QAAQ,CAAKA,UAA4C;CAC3D,MAAM,EACF,SAAS,EAAE,UAAU,SAAS,EAC9B,GAAG,EAAE,YAAY,aAAa,EACjC,GAAG,eAAe;CAEnB,MAAMC,IAAmB,kBAAkB;EACvC,MAAM;EACN;EACA;CACH,EAAC;CAEF,MAAM,oBAAoB,EAAE,KAAK,MAAgB;AAC7C,SAAO,WAAW;CACrB,GAAE,CACC,UACH,EAAC;CAEF,MAAM,UAAU,MAAY;EACxB,YAAY,UAAU;CACzB,GAAE,CACC,WACH,EAAC;CAEF,MAAM,EAAE,UAAU,qBAAqB,UAAU,GAAG,mBAAmB,EACnE,OAAO,EACV,EAAC;AAEF,4BACK;EACG,GAAI;EACJ,KAAK;EACL,gCACI,EAAE,kCAAkC;EAExC,8BAA8B;EACpB;EACW;EACX;EACV,YAAY;EACZ,qBAAqB,EAAE,uBAAuB;YAE7C,EAAE;GACI;AAElB"}