当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ag-grid-community.Utils类代码示例

本文整理汇总了TypeScript中ag-grid-community.Utils的典型用法代码示例。如果您正苦于以下问题:TypeScript Utils类的具体用法?TypeScript Utils怎么用?TypeScript Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Utils类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: workbook

    private workbook(docProperties: XmlElement, eWorkbook: XmlElement, styles: ExcelStyle[], worksheets: ExcelWorksheet[]) : XmlElement {
        const children : XmlElement [] = [
            docProperties,
            eWorkbook,
            this.stylesXmlElement(styles)
        ].concat(Utils.map(worksheets, (it):XmlElement => worksheet.getTemplate(it)));

        return Utils.assign({}, workbook.getTemplate(), {children});
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:9,代码来源:excelXmlFactory.ts

示例2: styleXmlElement

    private styleXmlElement(styleProperties:ExcelStyle):XmlElement {
        const children = Utils.compose(
            this.addProperty('alignment', styleProperties),
            this.addProperty('borders', styleProperties),
            this.addProperty('font', styleProperties),
            this.addProperty('interior', styleProperties),
            this.addProperty('protection', styleProperties),
            this.addProperty('numberFormat', styleProperties)
        )([]);

        return Utils.assign({}, style.getTemplate(styleProperties), {children});
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:12,代码来源:excelXmlFactory.ts

示例3: setState

 public setState(value: any, valueFormatted: string, selected: boolean): void {
     let rendererSuccessful = this.populateWithRenderer(value, valueFormatted);
     if (!rendererSuccessful) {
         this.populateWithoutRenderer(value, valueFormatted);
     }
     Utils.addOrRemoveCssClass(this.getGui(), 'ag-rich-select-row-selected', selected);
 }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:7,代码来源:richSelectRow.ts

示例4: stylesXmlElement

 private stylesXmlElement(styles:ExcelStyle[]):XmlElement {
     return {
         name:'Styles',
         children:styles ? Utils.map(styles, (it) => {
             return this.styleXmlElement (it);
         }): []
     };
 }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:8,代码来源:excelXmlFactory.ts

示例5: populateWithoutRenderer

    private populateWithoutRenderer(value: any, valueFormatted: string) {
        let valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;
        let valueToRender = valueFormattedExits ? valueFormatted : value;

        if (Utils.exists(valueToRender) && valueToRender !== '') {
            // not using innerHTML to prevent injection of HTML
            // https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations
            this.getGui().textContent = valueToRender.toString();
        } else {
            // putting in blank, so if missing, at least the user can click on it
            this.getGui().innerHTML = ' ';
        }
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:13,代码来源:richSelectRow.ts

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

示例7: showMenu

    public showMenu(node: RowNode, column: Column, value: any, mouseEvent: MouseEvent | Touch): void {

        let menuItems = this.getMenuItems(node, column, value);

        if (Utils.missingOrEmpty(menuItems)) { return; }

        let menu = new ContextMenu(menuItems);
        this.context.wireBean(menu);

        let eMenuGui =  menu.getGui();

        // need to show filter before positioning, as only after filter
        // is visible can we find out what the width of it is
        let hidePopup = this.popupService.addAsModalPopup(
            eMenuGui,
            true,
            ()=> menu.destroy(),
            mouseEvent
        );

        this.popupService.positionPopupUnderMouseEvent({
            column: column,
            rowNode: node,
            type: 'contextMenu',
            mouseEvent: mouseEvent,
            ePopup: eMenuGui
        });

        menu.afterGuiAttached({
            hidePopup: hidePopup
        });

        this.activeMenu = menu;
        menu.addEventListener(BeanStub.EVENT_DESTROYED, ()=> {
            if (this.activeMenu===menu) {
                this.activeMenu = null;
            }
        });
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:39,代码来源:contextMenu.ts

示例8: getTemplate

import {XmlElement, Utils} from 'ag-grid-community';
import {ExcelXMLTemplate, ExcelWorksheet} from 'ag-grid-community';
import column from './column';
import row from './row';

const worksheet: ExcelXMLTemplate = {
    getTemplate(ws: ExcelWorksheet): XmlElement {
        const {table, name} = ws;
        const {columns, rows} = table;

        const c = Utils.map(columns, (it):XmlElement => column.getTemplate(it));
        const r = Utils.map(rows, (it):XmlElement => row.getTemplate(it));

        return {
            name: "Worksheet",
            children:[{
                name:"Table",
                children: c.concat(r)
            }],
            properties:{
                prefixedAttributes: [{
                    prefix:"ss:",
                    map: {
                        Name: name
                    }
                }]
            }
        };
    }
};
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:30,代码来源:worksheet.ts

示例9: getTemplate

import {XmlElement, Utils} from 'ag-grid-community';
import {ExcelCell, ExcelRow, ExcelXMLTemplate} from 'ag-grid-community';
import cell from './cell';

const row: ExcelXMLTemplate = {
    getTemplate(r: ExcelRow): XmlElement {
        const {cells} = r;

        return {
            name: "Row",
            children: Utils.map(cells, (it:ExcelCell):XmlElement => {
                return cell.getTemplate(it);
            })
        };
    }
};

export default row;
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:18,代码来源:row.ts


注:本文中的ag-grid-community.Utils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。