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


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

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


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

示例1:

const getGs = (props: GsType): XmlElement => {
    const [pos, schemeColor, satMod, lumMod, tint, shade] = props;
    const children: XmlElement[] = [];

    children.push(getPropertyVal('satMod', satMod));
    if (lumMod) children.push(getPropertyVal('lumMod', lumMod));
    if (tint) children.push(getPropertyVal('tint', tint));
    if (shade) children.push(getPropertyVal('shade', shade));

    return {
        name: 'a:gs',
        properties: {
            rawMap: {
                pos
            }
        },
        children: [{
            name: 'a:schemeClr',
            properties: {
                rawMap: {
                    val: schemeColor
                }
            },
            children
        }]
    };
};
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:27,代码来源:formatScheme.ts

示例2: getGs

const getGradFill = (props: [string, GsType, GsType, GsType, LinType]): XmlElement => {
    const [rotWithShape, gs1, gs2, gs3, lin] = props;
    const [ang, scaled] = lin;
    return {
        name: 'a:gradFill',
        properties: {
            rawMap: {
                rotWithShape
            }
        },
        children: [{
            name: 'a:gsLst',
            children: [
                getGs(gs1),
                getGs(gs2),
                getGs(gs3)
            ]
        },{
            name: 'a:lin',
            properties: {
                rawMap: {
                    ang: ang,
                    scaled: scaled
                }
            }
        }]
    };
};
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:28,代码来源:formatScheme.ts

示例3: getEffectStyle

const getEffectStyleList = (): XmlElement => ({
    name: 'a:effectStyleLst',
    children: [
        getEffectStyle(),
        getEffectStyle(),
        getEffectStyle(['57150', '19050', '5400000', 'ctr', '0'])
    ]
});
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:8,代码来源:formatScheme.ts

示例4: getLine

const getLineStyleList = (): XmlElement => ({
    name: 'a:lnStyleLst',
    children: [
        getLine(['6350', 'flat', 'sng', 'ctr']),
        getLine(['12700', 'flat', 'sng', 'ctr']),
        getLine(['19050', 'flat', 'sng', 'ctr'])
    ]
});
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:8,代码来源:formatScheme.ts

示例5: getSolidFill

const getBgFillStyleList = (): XmlElement => ({
    name: 'a:bgFillStyleLst',
    children: [
        getSolidFill('phClr'),
        getSolidFill('phClr', [
            getPropertyVal('tint', '95000'),
            getPropertyVal('satMod', '170000'),
        ]),
        getGradFill([
            '1',
            ['0', 'phClr', '150000', '102000', '93000', '98000'],
            ['50000', 'phClr', '130000', '103000', '98000', '90000'],
            ['100000', 'phClr', '120000', undefined, undefined, '63000'],
            ['5400000', '0']
        ])
    ]
});
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:17,代码来源:formatScheme.ts

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

示例7: convertLegacyColor

import {ExcelOOXMLTemplate, XmlElement} from 'ag-grid-community';
import {convertLegacyColor} from './stylesheet';

const getBorderColor = (color: string): XmlElement => {
    return {
        name: 'color',
        properties: {
            rawMap: {
                rgb: convertLegacyColor(color || '#000000')
            }
        }
    };
};

const borderFactory: ExcelOOXMLTemplate = {
    getTemplate(border: BorderSet) {
        const {left, right, top, bottom, diagonal} = border;
        const leftChildren = left ? [getBorderColor(left.color)] : undefined;
        const rightChildren = right ? [getBorderColor(right.color)] : undefined;
        const topChildren = top ? [getBorderColor(top.color)] : undefined;
        const bottomChildren = bottom ? [getBorderColor(bottom.color)] : undefined;
        const diagonalChildren = diagonal ? [getBorderColor(diagonal.color)] : undefined;
        return {
            name: 'border',
            children: [{
                name: 'left',
                properties: { rawMap: { style: left && left.style } },
                children: leftChildren
            },{
                name: 'right',
                properties: { rawMap: { style: right && right.style } },
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:31,代码来源:border.ts

示例8: getTemplate

import {ExcelOOXMLTemplate, XmlElement, _} from 'ag-grid-community';

const getFont = (props: [string, string, string?, string?]): XmlElement => {
    const [type, typeface, script, panose] = props;
    return {
        name: `a:${type}`,
        properties: {
            rawMap: {
                script,
                typeface,
                panose
            }
        }
    };
};

const fontScheme: ExcelOOXMLTemplate = {
    getTemplate() {
        const {utf8_encode} = _;
        return {
            name: "a:fontScheme",
            properties: {
                rawMap: {
                    name: "Office"
                }
            },
            children: [{
                name: 'a:majorFont',
                children: [
                    getFont(['latin', 'Calibri Light', undefined, '020F0302020204030204']),
                    getFont(['ea', '']),
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:31,代码来源:fontScheme.ts


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