UNPKG

@botonic/plugin-flow-builder

Version:

Use Flow Builder to show your contents

29 lines 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FlowWhatsappButtonListSection = void 0; const content_fields_base_1 = require("../content-fields-base"); const flow_whatsapp_button_list_row_1 = require("./flow-whatsapp-button-list-row"); class FlowWhatsappButtonListSection extends content_fields_base_1.ContentFieldsBase { constructor() { super(...arguments); this.title = ''; this.rows = []; } static fromHubtypeCMS(component, locale, cmsApi) { const newButton = new FlowWhatsappButtonListSection(component.id); newButton.title = this.getTextByLocale(locale, component.title); newButton.rows = component.rows.map(row => flow_whatsapp_button_list_row_1.FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi)); return newButton; } toBotonic(sectionIndex) { const rows = this.rows.reduce((acc, row, rowIndex) => { const botonicRow = row.toBotonic(rowIndex, sectionIndex); if (botonicRow) acc.push(botonicRow); return acc; }, []); return { title: this.title, rows }; } } exports.FlowWhatsappButtonListSection = FlowWhatsappButtonListSection; //# sourceMappingURL=flow-whatsapp-button-list-section.js.map