{"version":3,"file":"/Users/anthonygubler/development/dojo-org/parade/src/InterfaceTable.tsx","sourceRoot":"","sources":["InterfaceTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AAWtC,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,UAAU,EAA4B,CAAC;AAEhE,eAAe,OAAO,CAAC,SAAS,cAAc,CAAC,EAAE,UAAU,EAAE;IAC5D,MAAM,EACL,KAAK,EACL,SAAS,GAAG,YAAY,EACxB,gBAAgB,GAAG,aAAa,EAChC,SAAS,GAAG,IAAI,EAChB,YAAY,GAAG,IAAI,EACnB,GAAG,UAAU,EAAE,CAAC;IACjB,IAAI,CAAC,KAAK,EAAE;QACX,OAAO,IAAI,CAAC;KACZ;IACD,OAAO,CACN;QACC,IAAC,cAAc,OAAG;QAClB,YAAI,OAAO,EAAC,eAAe,IAAE,SAAS,CAAM;QAC5C,IAAC,UAAU;YACV,eAAO,OAAO,EAAC,OAAO;gBACrB;oBACC;wBACC,YAAI,OAAO,EAAC,+GAA+G,WAEtH;wBACJ,SAAS,IAAI,CACb,YAAI,OAAO,EAAC,iGAAiG,WAExG,CACL;wBACA,YAAY,IAAI,CAChB,YAAI,OAAO,EAAC,sGAAsG,IAChH,gBAAgB,CACb,CACL,CACG,CACE;gBACR,mBACE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACnB,OAAO,CACN;wBACC,YAAI,OAAO,EAAC,mBAAmB,IAAE,GAAG,IAAI,CAAC,IAAI,GAC5C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EACvB,EAAE,CAAM;wBACP,SAAS,IAAI,YAAI,OAAO,EAAC,mBAAmB,IAAE,IAAI,CAAC,IAAI,CAAM;wBAC7D,YAAY,IAAI,CAChB,YAAI,OAAO,EAAC,mBAAmB,IAAE,IAAI,CAAC,WAAW,CAAM,CACvD,CACG,CACL,CAAC;gBACH,CAAC,CAAC,CACK,CACD,CACI,CACJ,CACV,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { create, tsx } from '@dojo/framework/core/vdom';\nimport HorizontalRule from './HorizontalRule';\nimport RoundedBox from './RoundedBox';\nimport { PropertyInterface } from './interfaces.block';\n\ninterface InterfaceTableProperties {\n\tprops?: PropertyInterface[];\n\ttableName?: string;\n\tdescriptionLabel?: string;\n\tshowTypes?: boolean;\n\tshowComments?: boolean;\n}\n\nconst factory = create().properties<InterfaceTableProperties>();\n\nexport default factory(function InterfaceTable({ properties }) {\n\tconst {\n\t\tprops,\n\t\ttableName = 'Properties',\n\t\tdescriptionLabel = 'Description',\n\t\tshowTypes = true,\n\t\tshowComments = true\n\t} = properties();\n\tif (!props) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<virtual>\n\t\t\t<HorizontalRule />\n\t\t\t<h2 classes=\"text-2xl mb-4\">{tableName}</h2>\n\t\t\t<RoundedBox>\n\t\t\t\t<table classes=\"table\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th classes=\"px-4 py-2 border-r border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100 rounded-tl-lg\">\n\t\t\t\t\t\t\t\tName\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t{showTypes && (\n\t\t\t\t\t\t\t\t<th classes=\"px-4 py-2 border-r border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100\">\n\t\t\t\t\t\t\t\t\tType\n\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{showComments && (\n\t\t\t\t\t\t\t\t<th classes=\"px-4 py-2 border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100 rounded-tr-lg\">\n\t\t\t\t\t\t\t\t\t{descriptionLabel}\n\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t{props.map((prop) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td classes=\"px-4 py-2 text-sm\">{`${prop.name}${\n\t\t\t\t\t\t\t\t\t\tprop.optional ? '?' : ''\n\t\t\t\t\t\t\t\t\t}`}</td>\n\t\t\t\t\t\t\t\t\t{showTypes && <td classes=\"px-4 py-2 text-sm\">{prop.type}</td>}\n\t\t\t\t\t\t\t\t\t{showComments && (\n\t\t\t\t\t\t\t\t\t\t<td classes=\"px-4 py-2 text-sm\">{prop.description}</td>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</RoundedBox>\n\t\t</virtual>\n\t);\n});\n"]}