本文整理匯總了TypeScript中ag-grid-community._.map方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript _.map方法的具體用法?TypeScript _.map怎麽用?TypeScript _.map使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ag-grid-community._
的用法示例。
在下文中一共展示了_.map方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import borderFactory, {BorderSet} from './border';
const bordersFactory: ExcelOOXMLTemplate = {
getTemplate(borders: BorderSet[]) {
return {
name: "borders",
properties: {
rawMap: {
count: borders.length
}
},
children: _.map(borders, borderFactory.getTemplate)
};
}
};
export default bordersFactory;
示例2: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import xfFactory, {Xf} from './xf';
const cellStylesXfsFactory: ExcelOOXMLTemplate = {
getTemplate(xf: Xf[]) {
return {
name: "cellStyleXfs",
properties: {
rawMap: {
count: xf.length
}
},
children: _.map(xf, xfFactory.getTemplate)
};
}
};
export default cellStylesXfsFactory;
示例3: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import cellStyleFactory, {CellStyle} from './cellStyle';
const cellStylesFactory: ExcelOOXMLTemplate = {
getTemplate(cellStyles: CellStyle[]) {
return {
name: "cellStyles",
properties: {
rawMap: {
count: cellStyles.length
}
},
children: _.map(cellStyles, cellStyleFactory.getTemplate)
};
}
};
export default cellStylesFactory;
示例4: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import fontFactory, {Font} from './font';
const fontsFactory: ExcelOOXMLTemplate = {
getTemplate(fonts: Font[]) {
return {
name: "fonts",
properties: {
rawMap: {
count: fonts.length
}
},
children: _.map(fonts, fontFactory.getTemplate)
};
}
};
export default fontsFactory;
示例5: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import sheetFactory from './sheet';
const sheetsFactory: ExcelOOXMLTemplate = {
getTemplate(names: string[]) {
return {
name: "sheets",
children: _.map(names, sheetFactory.getTemplate)
};
}
};
export default sheetsFactory;
示例6: getExcelColumnName
if (pos < tableWidth) return fromCharCode(startCode + pos - 1) + fromCharCode(startCode + tableIdx - 1);
return getExcelColumnName(pos) + fromCharCode(startCode + tableIdx - 1);
};
const worksheetFactory: ExcelOOXMLTemplate = {
getTemplate(config: ExcelWorksheet) {
const {table} = config;
const {rows, columns} = table;
const mergedCells = getMergedCells(rows, columns);
const children = [].concat(
columns.length ? {
name: 'cols',
children: _.map(columns, columnFactory.getTemplate)
} : []
).concat(
rows.length ? {
name: 'sheetData',
children: _.map(rows, rowFactory.getTemplate)
} : []
).concat(
mergedCells.length ? {
name: 'mergeCells',
properties: {
rawMap: {
count: mergedCells.length
}
},
children: _.map(mergedCells, mergeCell.getTemplate)
示例7: getTemplate
import {ExcelOOXMLTemplate, XmlElement, _} from 'ag-grid-community';
const buildSharedString = (textNode: string): XmlElement => ({
name: 'si',
children: [{
name: 't',
textNode: _.utf8_encode(_.escape(textNode.toString()))
}]
});
const sharedStrings: ExcelOOXMLTemplate = {
getTemplate(strings: string[]) {
return {
name: "sst",
properties: {
rawMap: {
xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
count: strings.length,
uniqueCount: strings.length
}
},
children: _.map(strings, buildSharedString)
};
}
};
export default sharedStrings;
示例8: getTemplate
import {ExcelOOXMLTemplate, _} from 'ag-grid-community';
import fillFactory, {Fill} from './fill';
const fillsFactory: ExcelOOXMLTemplate = {
getTemplate(fills: Fill[]) {
return {
name: "fills",
properties: {
rawMap: {
count: fills.length
}
},
children: _.map(fills, fillFactory.getTemplate)
};
}
};
export default fillsFactory;
示例9: getTemplate
import {ExcelOOXMLTemplate, ExcelRelationship, _} from 'ag-grid-community';
import relationshipFactory from './relationship';
const relationshipsFactory: ExcelOOXMLTemplate = {
getTemplate(c: ExcelRelationship[]) {
const children = _.map(c, relationshipFactory.getTemplate);
return {
name: "Relationships",
properties: {
rawMap: {
xmlns: "http://schemas.openxmlformats.org/package/2006/relationships"
}
},
children
};
}
};
export default relationshipsFactory;
示例10: getTemplate
import {ExcelOOXMLTemplate, ExcelRow, _} from 'ag-grid-community';
import cellFactory from './cell';
const rowFactory: ExcelOOXMLTemplate = {
getTemplate(config: ExcelRow) {
const {index, collapsed, hidden, height, outlineLevel, s, cells = []} = config;
const children = _.map(cells, cellFactory.getTemplate);
return {
name: "row",
properties: {
rawMap: {
r: index,
collapsed,
hidden: hidden ? '1' : '0',
ht: height,
customHeight: height != null ? '1' : '0',
s,
customFormat: s != null ? '1' : '0'
}
},
children
};
}
};
export default rowFactory;