UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

23 lines (22 loc) 1.09 kB
import { PageAnchoredObjectHolder } from '../../../../layout-formatter/floating/page-anchored-object-holder'; import { Pair } from '@devexpress/utils/lib/class/pair'; import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number'; import { BaseFormatter, StdProps } from '../base-formatter'; export class CCF_PageAnchoredObjectHolder extends BaseFormatter { isHandleObject(obj) { return obj instanceof PageAnchoredObjectHolder; } getShortDescription(_config) { return this.stdShow(new StdProps(this.getList()).showAsLine().setStdNumElements()); } availableFullDescription(_config) { return !NumberMapUtils.isEmpty(this.curr.objects); } getFullDescription(_config) { return this.stdShow(new StdProps(this.getList()).showAsColumn()); } getList() { return this.mapNumberAsKeyToListOfPairs(this.curr.objects, (key) => key, (key, obj) => new Pair(key.toString(), obj)); } } CCF_PageAnchoredObjectHolder._foo = BaseFormatter.addToFormattersList(new CCF_PageAnchoredObjectHolder());