1 | {"version":3,"file":"DocTableRow.js","sourceRoot":"","sources":["../../src/nodes/DocTableRow.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAAkF;AAElF,iDAA8C;AAO9C;;GAEG;AACH,MAAa,WAAY,SAAQ,eAAO;IAGtC,YAAmB,UAAkC,EAAE,KAAmC;QACxF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,EAAE;YACT,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aACpB;SACF;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,mDAAkC;IACpC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,OAAO,CAAC,IAAkB;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,gBAAgB;QACrB,MAAM,OAAO,GAAiB,IAAI,2BAAY,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,gBAAgB,CAAC,WAAmB;QACzC,MAAM,IAAI,GAAiB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAChC,IAAI,oBAAY,CAAC;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,WAAW;SAClB,CAAC,CACH,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAhDD,kCAgDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode, DocPlainText } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTableRow}.\n */\nexport interface IDocTableRowParameters extends IDocNodeParameters {}\n\n/**\n * Represents table row, similar to an HTML `<tr>` element.\n */\nexport class DocTableRow extends DocNode {\n private readonly _cells: DocTableCell[];\n\n public constructor(parameters: IDocTableRowParameters, cells?: ReadonlyArray<DocTableCell>) {\n super(parameters);\n\n this._cells = [];\n if (cells) {\n for (const cell of cells) {\n this.addCell(cell);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableRow;\n }\n\n public get cells(): ReadonlyArray<DocTableCell> {\n return this._cells;\n }\n\n public addCell(cell: DocTableCell): void {\n this._cells.push(cell);\n }\n\n public createAndAddCell(): DocTableCell {\n const newCell: DocTableCell = new DocTableCell({ configuration: this.configuration });\n this.addCell(newCell);\n return newCell;\n }\n\n public addPlainTextCell(cellContent: string): DocTableCell {\n const cell: DocTableCell = this.createAndAddCell();\n cell.content.appendNodeInParagraph(\n new DocPlainText({\n configuration: this.configuration,\n text: cellContent\n })\n );\n return cell;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return this._cells;\n }\n}\n"]} |