本文整理匯總了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()))
}]
});
示例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;
}
}
示例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;
}
}
示例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} : {})]
};
};
示例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;
示例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;
示例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;
示例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;
示例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)
示例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;