本文整理匯總了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
}]
};
};
示例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
}
}
}]
};
};
示例3: getEffectStyle
const getEffectStyleList = (): XmlElement => ({
name: 'a:effectStyleLst',
children: [
getEffectStyle(),
getEffectStyle(),
getEffectStyle(['57150', '19050', '5400000', 'ctr', '0'])
]
});
示例4: getLine
const getLineStyleList = (): XmlElement => ({
name: 'a:lnStyleLst',
children: [
getLine(['6350', 'flat', 'sng', 'ctr']),
getLine(['12700', 'flat', 'sng', 'ctr']),
getLine(['19050', 'flat', 'sng', 'ctr'])
]
});
示例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']
])
]
});
示例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} : {})]
};
};
示例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 } },
示例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', '']),