UNPKG

@umbraco/json-models-builders

Version:
47 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BlockGridContentDataBuilder = void 0; const blockGridContentDataValueBuilder_1 = require("./blockGridContentDataValueBuilder"); class BlockGridContentDataBuilder { parentBuilder; contentTypeKey; key; udi; contentDataValueBuilder; constructor(parentBuilder) { this.parentBuilder = parentBuilder; this.contentDataValueBuilder = []; } withContentTypeKey(contentTypeKey) { this.contentTypeKey = contentTypeKey; return this; } withKey(key) { this.key = key; return this; } withUdi(udi) { this.udi = udi; return this; } addContentDataValue() { const builder = new blockGridContentDataValueBuilder_1.BlockGridContentDataValueBuilder(this); this.contentDataValueBuilder.push(builder); return builder; } done() { return this.parentBuilder; } getValue() { return { contentTypeKey: this.contentTypeKey, key: this.key, udi: this.udi || null, values: this.contentDataValueBuilder.map((builder) => { return builder.getValue(); }) }; } } exports.BlockGridContentDataBuilder = BlockGridContentDataBuilder; //# sourceMappingURL=blockGridContentDataBuilder.js.map