()
| 860 | // Model |
| 861 | |
| 862 | get model() { |
| 863 | const model = { |
| 864 | id: this.id, |
| 865 | name: this.name, |
| 866 | dataValidations: this.dataValidations.model, |
| 867 | properties: this.properties, |
| 868 | state: this.state, |
| 869 | pageSetup: this.pageSetup, |
| 870 | headerFooter: this.headerFooter, |
| 871 | rowBreaks: this.rowBreaks, |
| 872 | views: this.views, |
| 873 | autoFilter: this.autoFilter, |
| 874 | media: this._media.map(medium => medium.model), |
| 875 | sheetProtection: this.sheetProtection, |
| 876 | tables: Object.values(this.tables).map(table => table.model), |
| 877 | pivotTables: this.pivotTables, |
| 878 | conditionalFormattings: this.conditionalFormattings, |
| 879 | }; |
| 880 | |
| 881 | // ================================================= |
| 882 | // columns |
| 883 | model.cols = Column.toModel(this.columns); |
| 884 | |
| 885 | // ========================================================== |
| 886 | // Rows |
| 887 | const rows = (model.rows = []); |
| 888 | const dimensions = (model.dimensions = new Range()); |
| 889 | this._rows.forEach(row => { |
| 890 | const rowModel = row && row.model; |
| 891 | if (rowModel) { |
| 892 | dimensions.expand(rowModel.number, rowModel.min, rowModel.number, rowModel.max); |
| 893 | rows.push(rowModel); |
| 894 | } |
| 895 | }); |
| 896 | |
| 897 | // ========================================================== |
| 898 | // Merges |
| 899 | model.merges = []; |
| 900 | _.each(this._merges, merge => { |
| 901 | model.merges.push(merge.range); |
| 902 | }); |
| 903 | |
| 904 | return model; |
| 905 | } |
| 906 | |
| 907 | _parseRows(model) { |
| 908 | this._rows = []; |
nothing calls this directly
no test coverage detected