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


TypeScript ag-grid-community._類代碼示例

本文整理匯總了TypeScript中ag-grid-community._的典型用法代碼示例。如果您正苦於以下問題:TypeScript _類的具體用法?TypeScript _怎麽用?TypeScript _使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了_類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

const buildSharedString = (textNode: string): XmlElement => ({
    name: 'si',
    children: [{
        name: 't',
        textNode: _.utf8_encode(_.escape(textNode.toString()))
    }]
});
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:7,代碼來源:sharedStrings.ts

示例2: populateWithRenderer

    private populateWithRenderer(value: any, valueFormatted: string): boolean {
        let promise:Promise<ICellRendererComp> = this.cellRendererService.useRichSelectCellRenderer(this.columnDef, this.getGui(), {value: value, valueFormatted: valueFormatted});

        let foundRenderer = _.exists(promise);
        if (foundRenderer) {
            promise.then(childComponent => {
                if (childComponent && childComponent.destroy) {
                    this.addDestroyFunc(childComponent.destroy.bind(childComponent));
                }
            });
            return true;
        } else {
            return false;
        }
    }
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:15,代碼來源:richSelectRow.ts

示例3: getMenuItems

    private getMenuItems(node: RowNode, column: Column, value: any): (MenuItemDef|string)[] {
        let defaultMenuOptions: string[];
        if (Utils.exists(node)) {

            defaultMenuOptions = [];

            if (column) {
                // only makes sense if column exists, could have originated from a row
                defaultMenuOptions = ['copy','copyWithHeaders','paste', 'separator'];
            }

            // if user clicks a cell
            let suppressExcel = this.gridOptionsWrapper.isSuppressExcelExport();
            let suppressCsv = this.gridOptionsWrapper.isSuppressCsvExport();
            let onIPad = _.isUserAgentIPad();
            let anyExport: boolean = !onIPad && (!suppressExcel || !suppressCsv);
            if (anyExport) {
                defaultMenuOptions.push('export');
            }
        } else {
            // if user clicks outside of a cell (eg below the rows, or not rows present)
            // nothing to show, perhaps tool panels???
        }
        if (this.gridOptionsWrapper.getContextMenuItemsFunc()) {
            let userFunc: GetContextMenuItems = this.gridOptionsWrapper.getContextMenuItemsFunc();
            let params: GetContextMenuItemsParams = {
                node: node,
                column: column,
                value: value,
                defaultItems: defaultMenuOptions,
                api: this.gridOptionsWrapper.getApi(),
                columnApi: this.gridOptionsWrapper.getColumnApi(),
                context: this.gridOptionsWrapper.getContext()
            };
            let menuItemsFromUser = userFunc(params);
            return menuItemsFromUser;
        } else {
            return defaultMenuOptions;
        }
    }
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:40,代碼來源:contextMenu.ts

示例4: getPropertyVal

const getEffectStyle = (shadow?: [string, string, string, string, string]): XmlElement => {
    const children: XmlElement[] = [];

    if (shadow) {
        const [blurRad, dist, dir, algn, rotWithShape] = shadow;
        children.push({
            name: 'a:outerShdw',
            properties: {
                rawMap: { blurRad, dist, dir, algn, rotWithShape }
            },
            children: [
                getPropertyVal('srgbClr', '000000', [getPropertyVal('alpha', '63000')])
            ]
        });
    }

    return {
        name: 'a:effectStyle',
        children: [_.assign({}, {
            name: 'a:effectLst'
        }, children.length ? {children} : {})]
    };
};
開發者ID:Hyeong-jin,項目名稱:ag-grid,代碼行數:23,代碼來源:formatScheme.ts

示例5: 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

示例6: 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

示例7: 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

示例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: 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

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