diff --git a/src/core-interfaces.ts b/src/core-interfaces.ts index 2febb219e..6bf3ffeb5 100644 --- a/src/core-interfaces.ts +++ b/src/core-interfaces.ts @@ -893,6 +893,8 @@ export interface TableProps extends PositionProps, TextBaseProps, ObjectNameProp * @deprecated v3.3.0 - use `autoPageSlideStartY` */ newSlideStartY?: number + + placeholder?: string } export interface TableCell { _type: SLIDE_OBJECT_TYPES.tablecell diff --git a/src/gen-objects.ts b/src/gen-objects.ts index 96499c2a8..9e3b97f17 100644 --- a/src/gen-objects.ts +++ b/src/gen-objects.ts @@ -731,6 +731,15 @@ export function addTableDefinition( let opt: TableProps = options && typeof options === 'object' ? options : {} opt.objectName = opt.objectName ? encodeXmlEntities(opt.objectName) : `Table ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.table).length}` + if (opt.placeholder && target._slideLayout && target._slideLayout._slideObjects) { + // Placeholder + let placeHold = target._slideLayout._slideObjects.filter( + item => item._type == 'placeholder' && item.options && item.options.placeholder && item.options.placeholder == opt.placeholder + )[0] + + if (placeHold && placeHold.options) opt = { ...opt, ...placeHold.options} + } + // STEP 1: REALITY-CHECK { // A: check for empty diff --git a/types/index.d.ts b/types/index.d.ts index 3ac0b6546..cbf2e2986 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1715,6 +1715,8 @@ declare namespace PptxGenJS { * @deprecated v3.3.0 - use `autoPageSlideStartY` */ newSlideStartY?: number + + placeholder?: string } export interface TableCell { text?: string | TableCell[]