import{_ as __rest,a as __assign,b as __spreadArray}from"./tslib.es6-bjGg6Bxl.js";import React__default from"react";var dataGridStyles="\n\tjn-grid\n\tjn-items-stretch\n",gridTemplate=function(a,b,c,d,e){var f;if(e&&0<e.length)return f={gridTemplateColumns:e},f;var g="";if(d&&Array.isArray(d)&&0<d.length){var h=__spreadArray([],Array(a),!0);h.map(function(a,e){g+=d.includes(e)?"min-content ":"minmax(".concat(c,", ").concat(b,") ")})}else g="repeat(".concat(a,", minmax(").concat(c,", ").concat(b,"))");return f={gridTemplateColumns:g},f},DataGridContext=React__default.createContext({}),useDataGridContext=function(){return React__default.useContext(DataGridContext)},DataGrid=function(a){var b=a.columns,c=void 0===b?1:b,d=a.columnMaxSize,e=void 0===d?"auto":d,f=a.columnMinSize,g=void 0===f?"0px":f,h=a.minContentColumns,i=a.gridColumnTemplate,j=a.cellVerticalAlignment,k=void 0===j?"center":j,l=a.className,m=void 0===l?"":l,n=a.children,o=void 0===n?null:n,p=__rest(a,["columns","columnMaxSize","columnMinSize","minContentColumns","gridColumnTemplate","cellVerticalAlignment","className","children"]);return React__default.createElement(DataGridContext.Provider,{value:{cellVerticalAlignment:k}},React__default.createElement("div",__assign({className:"juno-datagrid ".concat(dataGridStyles," ").concat(m),style:gridTemplate(c,e,g,h,i),role:"grid"},p),o))};export{DataGrid as D,useDataGridContext as u};