本文整理汇总了TypeScript中@ephox/snooker.TableFill.cellOperations方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TableFill.cellOperations方法的具体用法?TypeScript TableFill.cellOperations怎么用?TypeScript TableFill.cellOperations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/snooker.TableFill
的用法示例。
在下文中一共展示了TableFill.cellOperations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
return function (table, target) {
Util.removeDataStyle(table);
const wire = lazyWire();
const doc = Element.fromDom(editor.getDoc());
const direction = TableDirection(Direction.directionAt);
const generators = TableFill.cellOperations(mutate, doc, cloneFormats);
return guard(table) ? operation(wire, table, target, generators, direction).bind(function (result) {
Arr.each(result.newRows(), function (row) {
fireNewRow(editor, row.dom());
});
Arr.each(result.newCells(), function (cell) {
fireNewCell(editor, cell.dom());
});
return result.cursor().map(function (cell) {
const rng = editor.dom.createRng();
rng.setStart(cell.dom(), 0);
rng.setEnd(cell.dom(), 0);
return rng;
});
}) : Option.none();
};
示例2: function
return function (table, target) {
const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
Arr.each(dataStyleCells, function (cell) {
Attr.remove(cell, 'data-mce-style');
});
const wire = lazyWire();
const doc = Element.fromDom(editor.getDoc());
const direction = TableDirection(Direction.directionAt);
const generators = TableFill.cellOperations(mutate, doc, cloneFormats);
return guard(table) ? operation(wire, table, target, generators, direction).bind(function (result) {
Arr.each(result.newRows(), function (row) {
fireNewRow(row);
});
Arr.each(result.newCells(), function (cell) {
fireNewCell(cell);
});
return result.cursor().map(function (cell) {
const rng = editor.dom.createRng();
rng.setStart(cell.dom(), 0);
rng.setEnd(cell.dom(), 0);
return rng;
});
}) : Option.none();
};
示例3: getTableFromCell
return getTableFromCell(cell).bind((table) => {
const doc = Element.fromDom(editor.getDoc());
const targets = TableTargets.forMenu(selections, table, cell);
const generators = TableFill.cellOperations(Fun.noop, doc, Option.none());
return CopyRows.copyRows(table, targets, generators);
});