{"version":3,"file":"TableView.DQEBbCcq.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/4yUqCD0qFCepeGLUza8M/U3zZDQUgOxZXp0CYrlbz/TableView.js"],"sourcesContent":["// Responsive table component with configurable rows, columns, and styling\n// Supports Desktop, Tablet, and Mobile layouts with customizable borders and colors\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,startTransition}from\"react\";/**\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function TableView(props){const{rows=[{cells:[{content:\"Header 1\"},{content:\"Header 2\"},{content:\"Header 3\"}]},{cells:[{content:\"Row 1, Col 1\"},{content:\"Row 1, Col 2\"},{content:\"Row 1, Col 3\"}]},{cells:[{content:\"Row 2, Col 1\"},{content:\"Row 2, Col 2\"},{content:\"Row 2, Col 3\"}]}],columnCount=3,headerBackgroundColor,headerTextColor,headerColors=[],cellBackgroundColor,cellTextColor,borderColor,borderWidth,showBorders,headerFont,cellFont,headerTextAlign=\"left\",cellTextAlign=\"left\",borderRadius=8,style}=props;const[layout,setLayout]=useState(\"desktop\");useEffect(()=>{if(typeof window===\"undefined\")return;const handleResize=()=>{const width=window.innerWidth;if(width<768){startTransition(()=>setLayout(\"mobile\"));}else if(width<1024){startTransition(()=>setLayout(\"tablet\"));}else{startTransition(()=>setLayout(\"desktop\"));}};handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[]);const borderStyle=showBorders?`${borderWidth}px solid ${borderColor}`:\"none\";const headerRow=rows.length>0?rows[0]:{cells:[]};const dataRows=rows.slice(1);const visibleColumns=Math.min(columnCount,headerRow.cells.length);const getHeaderColor=index=>{return headerColors[index]?.backgroundColor||headerBackgroundColor;};if(layout===\"mobile\"){return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",overflow:\"auto\",position:\"relative\"},children:dataRows.map((row,rowIndex)=>/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:16,border:showBorders?borderStyle:\"none\",borderRadius:borderRadius,overflow:\"hidden\"},children:row.cells.slice(0,visibleColumns).map((cell,cellIndex)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",borderBottom:cellIndex<visibleColumns-1?borderStyle:\"none\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{flex:1,padding:12,backgroundColor:getHeaderColor(cellIndex),color:headerTextColor,...headerFont,fontWeight:600,textAlign:headerTextAlign},children:headerRow.cells[cellIndex]?.content||\"\"}),/*#__PURE__*/_jsx(\"div\",{style:{flex:2,padding:12,backgroundColor:cellBackgroundColor,color:cellTextColor,...cellFont,borderLeft:borderStyle,textAlign:cellTextAlign},children:cell.content})]},cellIndex))},rowIndex))});}if(layout===\"tablet\"){const columnsToShow=Math.min(2,visibleColumns);return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",overflow:\"auto\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"table\",{style:{width:\"100%\",borderCollapse:\"collapse\",border:showBorders?borderStyle:\"none\",borderRadius:borderRadius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"thead\",{children:/*#__PURE__*/_jsx(\"tr\",{children:headerRow.cells.slice(0,columnsToShow).map((cell,index)=>/*#__PURE__*/_jsx(\"th\",{style:{padding:12,backgroundColor:getHeaderColor(index),color:headerTextColor,textAlign:headerTextAlign,...headerFont,borderRight:index<columnsToShow-1?borderStyle:\"none\",borderBottom:borderStyle},children:cell.content},index))})}),/*#__PURE__*/_jsx(\"tbody\",{children:dataRows.map((row,rowIndex)=>/*#__PURE__*/_jsx(\"tr\",{children:row.cells.slice(0,columnsToShow).map((cell,cellIndex)=>/*#__PURE__*/_jsx(\"td\",{style:{padding:12,backgroundColor:cellBackgroundColor,color:cellTextColor,textAlign:cellTextAlign,...cellFont,borderRight:cellIndex<columnsToShow-1?borderStyle:\"none\",borderBottom:rowIndex<dataRows.length-1?borderStyle:\"none\"},children:cell.content},cellIndex))},rowIndex))})]})});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",overflow:\"auto\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"table\",{style:{width:\"100%\",borderCollapse:\"collapse\",border:showBorders?borderStyle:\"none\",borderRadius:borderRadius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"thead\",{children:/*#__PURE__*/_jsx(\"tr\",{children:headerRow.cells.slice(0,visibleColumns).map((cell,index)=>/*#__PURE__*/_jsx(\"th\",{style:{padding:12,backgroundColor:getHeaderColor(index),color:headerTextColor,textAlign:headerTextAlign,...headerFont,borderRight:index<visibleColumns-1?borderStyle:\"none\",borderBottom:borderStyle},children:cell.content},index))})}),/*#__PURE__*/_jsx(\"tbody\",{children:dataRows.map((row,rowIndex)=>/*#__PURE__*/_jsx(\"tr\",{children:row.cells.slice(0,visibleColumns).map((cell,cellIndex)=>/*#__PURE__*/_jsx(\"td\",{style:{padding:12,backgroundColor:cellBackgroundColor,color:cellTextColor,textAlign:cellTextAlign,...cellFont,borderRight:cellIndex<visibleColumns-1?borderStyle:\"none\",borderBottom:rowIndex<dataRows.length-1?borderStyle:\"none\"},children:cell.content},cellIndex))},rowIndex))})]})});}addPropertyControls(TableView,{rows:{type:ControlType.Array,title:\"Rows\",control:{type:ControlType.Object,controls:{cells:{type:ControlType.Array,title:\"Cells\",control:{type:ControlType.Object,controls:{content:{type:ControlType.String,title:\"Content\",defaultValue:\"Cell\"}}},defaultValue:[{content:\"Cell 1\"},{content:\"Cell 2\"},{content:\"Cell 3\"}]}}},defaultValue:[{cells:[{content:\"Header 1\"},{content:\"Header 2\"},{content:\"Header 3\"}]},{cells:[{content:\"Row 1, Col 1\"},{content:\"Row 1, Col 2\"},{content:\"Row 1, Col 3\"}]},{cells:[{content:\"Row 2, Col 1\"},{content:\"Row 2, Col 2\"},{content:\"Row 2, Col 3\"}]}]},columnCount:{type:ControlType.Number,title:\"Columns\",defaultValue:3,min:1,max:10,step:1,displayStepper:true},headerBackgroundColor:{type:ControlType.Color,title:\"Header Background\",defaultValue:\"#000000\"},headerColors:{type:ControlType.Array,title:\"Column Header Colors\",control:{type:ControlType.Object,controls:{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"}}},defaultValue:[]},headerTextColor:{type:ControlType.Color,title:\"Header Text\",defaultValue:\"#FFFFFF\"},cellBackgroundColor:{type:ControlType.Color,title:\"Cell Background\",defaultValue:\"#FFFFFF\"},cellTextColor:{type:ControlType.Color,title:\"Cell Text\",defaultValue:\"#000000\"},showBorders:{type:ControlType.Boolean,title:\"Show Borders\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\",hidden:({showBorders})=>!showBorders},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:1,max:5,step:1,unit:\"px\",hidden:({showBorders})=>!showBorders},headerFont:{type:ControlType.Font,title:\"Header Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},headerTextAlign:{type:ControlType.Enum,title:\"Header Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},cellFont:{type:ControlType.Font,title:\"Cell Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},cellTextAlign:{type:ControlType.Enum,title:\"Cell Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableView\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TableView.map"],"mappings":"6MAOG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,WAAW,CAAC,CAAC,QAAQ,WAAW,CAAC,CAAC,QAAQ,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,cAAY,EAAE,wBAAsB,kBAAgB,eAAa,EAAE,CAAC,sBAAoB,gBAAc,cAAY,cAAY,cAAY,aAAW,WAAS,kBAAgB,OAAO,gBAAc,OAAO,eAAa,EAAE,SAAO,EAAW,CAAC,EAAO,GAAWA,EAAS,UAAU,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAM,EAAO,WAAyB,EAAX,EAAM,QAAyB,EAAU,SAAS,CAAW,EAAM,SAA0B,EAAU,SAAS,KAA4B,EAAU,UAAU,CAAC,EAAkE,OAA9D,GAAc,CAAC,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAC,IAAM,EAAY,EAAY,GAAG,EAAY,WAAW,IAAc,OAAa,EAAU,EAAK,OAAO,EAAE,EAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAO,EA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