@umbraco/json-models-builders
Version:
Builders and models for Umbraco Sites
56 lines • 2.02 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockListValueBuilder = void 0;
const blockListContentDataBuilder_1 = require("./blockListContentDataBuilder");
const blockListExposeBuilder_1 = require("./blockListExposeBuilder");
const blockListLayoutBuilder_1 = require("./blockListLayoutBuilder");
class BlockListValueBuilder {
parentBuilder;
blockListContentDataBuilder;
blockListExposeBuilder;
blockListLayoutBuilder;
blockListSettingDataBuilder;
constructor(parentBuilder) {
this.parentBuilder = parentBuilder;
this.blockListContentDataBuilder = [];
this.blockListExposeBuilder = [];
this.blockListLayoutBuilder = [];
this.blockListSettingDataBuilder = [];
}
addContentData() {
const builder = new blockListContentDataBuilder_1.BlockListContentDataBuilder(this);
this.blockListContentDataBuilder.push(builder);
return builder;
}
addExpose() {
const builder = new blockListExposeBuilder_1.BlockListExposeBuilder(this);
this.blockListExposeBuilder.push(builder);
return builder;
}
addLayout() {
const builder = new blockListLayoutBuilder_1.BlockListLayoutBuilder(this);
this.blockListLayoutBuilder.push(builder);
return builder;
}
done() {
return this.parentBuilder;
}
getValue() {
return {
contentData: this.blockListContentDataBuilder.map((builder) => {
return builder.getValue();
}),
expose: this.blockListExposeBuilder.map((builder) => {
return builder.getValue();
}),
layout: {
'Umbraco.BlockList': this.blockListLayoutBuilder.map((builder) => {
return builder.getValue();
})
},
settingsData: []
};
}
}
exports.BlockListValueBuilder = BlockListValueBuilder;
//# sourceMappingURL=blockListValueBuilder.js.map
;