-
Notifications
You must be signed in to change notification settings - Fork 2
/
PrintMarkup.ts
34 lines (31 loc) · 1.31 KB
/
PrintMarkup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Dictionary } from '../util/Dictionary';
import { StringDictionary } from '../util/StringDictionary';
import { AttributeCellValue } from './AttributeCellValue';
import { Cell } from './Cell';
import { CellValue } from './CellValue';
import { View } from './View';
export class PrintMarkup extends View {
public readonly cancelButtonText: string;
public readonly commitButtonText: string;
public readonly editable: boolean;
public readonly focusPropName: string;
public readonly printMarkupXML: string;
public readonly rows: Cell[][];
private _orderedCellValue: Dictionary<AttributeCellValue> = null;
get orderedCellValues(): StringDictionary {
if (!this._orderedCellValue) {
this._orderedCellValue = {};
this.rows.forEach((cellRow: Cell[]) => {
cellRow.forEach((cell: Cell) => {
cell.values.forEach((cellValue: CellValue) => {
if (cellValue instanceof AttributeCellValue) {
const attributeCellValue = cellValue as AttributeCellValue;
this._orderedCellValue[attributeCellValue.propertyName] = attributeCellValue;
}
});
});
});
}
return this._orderedCellValue;
}
}