當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript _.map方法代碼示例

本文整理匯總了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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:18,代碼來源:borders.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:18,代碼來源:cellStyleXfs.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:18,代碼來源:cellStyles.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:18,代碼來源:fonts.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:13,代碼來源:sheets.ts

示例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)
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:31,代碼來源:worksheet.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:27,代碼來源:sharedStrings.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:18,代碼來源:fills.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:20,代碼來源:relationships.ts

示例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;
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:26,代碼來源:row.ts


注:本文中的ag-grid-community._.map方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。