{"version":3,"file":"DynamicTable.D5eh263n.mjs","names":[],"sources":["https:/framerusercontent.com/modules/dxixVdr4cdwbBbfZf6HH/FWi6m9uUGsQe3VuPeJa5/DynamicTable.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";export function DynamicTable(props){const{data,headerBg,headerColor,rowBg,rowAltBg,textColor,align,fontSize,borderRadius}=props;let rows;try{rows=JSON.parse(data);}catch(e){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"red\"},children:\"Invalid JSON\"});}if(!Array.isArray(rows)||rows.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#666\"},children:\"No data\"});}const headers=Object.keys(rows[0]);return /*#__PURE__*/_jsx(\"div\",{style:{overflowX:\"auto\",width:\"100%\",borderRadius,WebkitOverflowScrolling:\"touch\"},children:/*#__PURE__*/_jsxs(\"table\",{style:{borderCollapse:\"collapse\",width:\"100%\",minWidth:\"500px\",borderRadius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"thead\",{children:/*#__PURE__*/_jsx(\"tr\",{style:{backgroundColor:headerBg},children:headers.map((header,i)=>/*#__PURE__*/_jsx(\"th\",{style:{color:headerColor,textAlign:align,padding:\"12px\",fontSize,whiteSpace:\"nowrap\",borderBottom:\"1px solid #ccc\"},children:header},i))})}),/*#__PURE__*/_jsx(\"tbody\",{children:rows.map((row,rowIndex)=>/*#__PURE__*/_jsx(\"tr\",{style:{backgroundColor:rowIndex%2===0?rowBg:rowAltBg||rowBg},children:headers.map((header,colIndex)=>/*#__PURE__*/_jsx(\"td\",{style:{color:textColor,textAlign:align,padding:\"12px\",fontSize,whiteSpace:\"nowrap\",wordBreak:\"break-word\",borderBottom:\"1px solid #eee\"},children:row[header]},colIndex))},rowIndex))})]})});}// 👇 Propriétés Framer\naddPropertyControls(DynamicTable,{data:{type:ControlType.String,title:\"Data (JSON)\",defaultValue:'[{\"Nom\":\"Alice\",\"Score\":42},{\"Nom\":\"Bob\",\"Score\":37},{\"Nom\":\"Carla\",\"Score\":50}]'},headerBg:{type:ControlType.Color,title:\"Header BG\",defaultValue:\"#111111\"},headerColor:{type:ControlType.Color,title:\"Header Text\",defaultValue:\"#ffffff\"},rowBg:{type:ControlType.Color,title:\"Row BG\",defaultValue:\"#ffffff\"},rowAltBg:{type:ControlType.Color,title:\"Alt Row BG\",defaultValue:\"#f5f5f5\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Gauche\",\"Centre\",\"Droite\"],defaultValue:\"left\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:30},borderRadius:{type:ControlType.Number,title:\"Border Radius\",min:0,max:50,defaultValue:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"DynamicTable\":{\"type\":\"reactComponent\",\"name\":\"DynamicTable\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicTable.map"],"mappings":"mKAA6G,SAAgB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,cAAY,QAAM,WAAS,YAAU,QAAM,WAAS,gBAAc,EAAU,EAAK,GAAG,CAAC,EAAK,KAAK,MAAM,CAAI,CAAE,MAAS,CAAC,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,EAAE,SAAS,cAAc,CAAC,CAAE,CAAC,GAAG,CAAC,MAAM,QAAQ,CAAI,GAAG,EAAK,SAAS,EAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,MAAM,EAAE,SAAS,SAAS,CAAC,EAAG,IAAM,EAAQ,OAAO,KAAK,EAAK,EAAE,EAAE,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,UAAU,OAAO,MAAM,OAAO,eAAa,wBAAwB,OAAO,EAAE,SAAsB,E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