@guiexpert/table 1.0.13 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { ColumnDefIf } from "../tablemodel/column/column-def.if";
3
3
  import { CellRendererIf } from "../../renderer/cell-render.if";
4
4
  import { AreaObjectMapType } from "./area-map.type";
5
5
  export declare class CheckboxColumnDef implements ColumnDefIf {
6
+ type: string;
6
7
  property: string;
7
8
  headerLabel: string;
8
9
  width: SizeIf;
@@ -5,5 +5,10 @@ export declare class TableCellUpdateEvent implements TableCellUpdateEventIf {
5
5
  rowIndex: number;
6
6
  columnIndex: number;
7
7
  value: any;
8
- constructor(area: AreaIdent, rowIndex: number, columnIndex: number, value: any);
8
+ cssClasses: {
9
+ [key: string]: boolean;
10
+ };
11
+ constructor(area: AreaIdent, rowIndex: number, columnIndex: number, value: any, cssClasses?: {
12
+ [key: string]: boolean;
13
+ });
9
14
  }
@@ -4,4 +4,7 @@ export interface TableCellUpdateEventIf {
4
4
  rowIndex: number;
5
5
  columnIndex: number;
6
6
  value: any;
7
+ cssClasses: {
8
+ [key: string]: boolean;
9
+ };
7
10
  }
@@ -1,9 +1,9 @@
1
- import { TreeRow } from "./tree-row";
2
1
  export interface TreeRowIf<T> {
2
+ type?: 'TreeRow' | '';
3
3
  data: T;
4
4
  expanded: boolean;
5
- children: TreeRow<T>[] | undefined;
6
- parent: TreeRow<T> | undefined;
5
+ children: TreeRowIf<T>[] | undefined;
6
+ parent: TreeRowIf<T> | undefined;
7
7
  deep: number;
8
8
  checked: boolean;
9
9
  keep: boolean;
@@ -7,5 +7,6 @@ export declare class TreeRow<T> implements TreeRowIf<T> {
7
7
  deep: number;
8
8
  checked: boolean;
9
9
  keep: boolean;
10
+ type: 'TreeRow' | '';
10
11
  constructor(data: T, expanded: boolean, children: TreeRowIf<T>[] | undefined, parent: TreeRowIf<T> | undefined, deep?: number, checked?: boolean, keep?: boolean);
11
12
  }
@@ -5,33 +5,35 @@ import { ColumnDefIf } from "../column/column-def.if";
5
5
  import { FilterFunction } from "../../common/filter-function";
6
6
  import { SorterService } from "../../../service/sorter.service";
7
7
  import { SortItem } from "../../common/sort-item";
8
+ import { TreeRowIf } from "../../common/tree-row-if";
8
9
  export declare class AreaModelTree<S> extends AbstractAreaModel<TreeRow<S>> {
9
10
  areaIdent: AreaIdent;
10
- readonly rows: TreeRow<S>[];
11
+ readonly rows: TreeRowIf<S>[];
11
12
  defaultRowHeight: number;
12
13
  protected columnDefs: ColumnDefIf[];
14
+ type: string;
13
15
  protected readonly properties: string[];
14
16
  protected sorterService: SorterService;
15
17
  private readonly service;
16
18
  private filteredFlattenRows;
17
19
  private flattenRows;
18
20
  private lastPredictFn?;
19
- constructor(areaIdent: AreaIdent, rows: TreeRow<S>[], defaultRowHeight: number, columnDefs?: ColumnDefIf[]);
21
+ constructor(areaIdent: AreaIdent, rows: TreeRowIf<S>[], defaultRowHeight: number, columnDefs?: ColumnDefIf[]);
20
22
  changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
21
23
  recalcVisibleTreeRows(): void;
22
- getFilteredFlattenRows(): TreeRow<S>[];
24
+ getFilteredFlattenRows(): TreeRowIf<S>[];
23
25
  getRowCount(): number;
24
26
  getValueAt(rowIndex: number, columnIndex: number): any;
25
27
  getRowHeight(_rowIndex: number): number;
26
28
  getCustomClassesAt(rowIndex: number, _columnIndex: number): string[];
27
- getRowByIndex(idx: number): TreeRow<S> | undefined;
29
+ getRowByIndex(idx: number): TreeRowIf<S> | undefined;
28
30
  getValueByT(t: S, property: string): any;
29
31
  externalFilterChanged<S>(predictFn: FilterFunction<S>): void;
30
32
  doSort(sortItems: SortItem[]): boolean;
31
33
  toggleExpandCollapseAll(expanded: boolean): void;
32
- setAllParentsOk(item: TreeRow<any>): boolean;
34
+ setAllParentsOk(item: TreeRowIf<any>): boolean;
33
35
  setValue(rowIndex: number, columnIndex: number, value: any): boolean;
34
- protected genericTreeTableSortComparator(property: string, f: number): (a: TreeRow<S>, b: TreeRow<S>) => number;
36
+ protected genericTreeTableSortComparator(property: string, f: number): (a: TreeRowIf<S>, b: TreeRowIf<S>) => number;
35
37
  private expandAllRecursive;
36
38
  private doFiltering;
37
39
  private getPropertyValue;
@@ -59,7 +59,7 @@ export interface AreaModelIf {
59
59
  /**
60
60
  * This return value is internally used to optimize the render performance.
61
61
  * Set this value to the lowest possible value. If the model has no rowspan,
62
- * a value of 0 would be good. The dafault is 32. If your model has a rowspan
62
+ * a value of 0 would be good. The default is 32. If your model has a rowspan
63
63
  * cell greater 32, don't forget to increase this value.
64
64
  */
65
65
  getMaxRowspan(): number;
@@ -1,6 +1,6 @@
1
- import { TreeRow } from "../data/common/tree-row";
1
+ import { TreeRowIf } from "../data/common/tree-row-if";
2
2
  export declare class TreeFactory {
3
- static buildTreeRows<T>(data: T[], childrenProperty?: string, deepMaxLimit?: number): TreeRow<T>[];
4
- static buildTreeRow<T>(data: T, childrenProperty?: string, parent?: TreeRow<T>, //, false , '0', '0'),
5
- deep?: number, deepMaxLimit?: number): TreeRow<T>;
3
+ static buildTreeRows<T>(data: T[], childrenProperty?: string, deepMaxLimit?: number): TreeRowIf<T>[];
4
+ static buildTreeRow<T>(data: T, childrenProperty?: string, parent?: TreeRowIf<T>, //, false , '0', '0'),
5
+ deep?: number, deepMaxLimit?: number): TreeRowIf<T>;
6
6
  }
@@ -0,0 +1,3 @@
1
+ export declare function isTreeRow(row: any): boolean;
2
+ export declare function isAreaModelTree(model: any): boolean;
3
+ export declare function isCheckboxColumnDef(o: any): boolean;
@@ -50,7 +50,7 @@ export declare class RenderScope extends EleScope {
50
50
  repaint(): void;
51
51
  adjustAfterScrolling(): void;
52
52
  checkForScrollPosSaving(): void;
53
- updateCells(events: TableCellUpdateEventIf[]): void;
53
+ updateCells(events: TableCellUpdateEventIf[], repaintAll?: boolean): void;
54
54
  protected getAreaAndSideIdentByAttr(srcElement: HTMLElement): [AreaIdent | undefined, SideIdent | undefined];
55
55
  protected getArea(rowIdent: AreaIdent, sideIdent: SideIdent): DivScope;
56
56
  protected adjustBody(): void;
@@ -72,6 +72,10 @@ export declare class RenderScope extends EleScope {
72
72
  protected adjustColumnsToRowParent({ areaIdent, sideIdent, areaModel, geo, parent, rowIndex, columnIndexStart, columnIndexEnd, verticalFixed, lastRowOfModel }: ArgsAdjustColumnsToRowParentParams): void;
73
73
  protected getTreeArrowColumnIndex(): 0 | 1;
74
74
  protected addAndRenderCellDiv({ areaModel, areaIdent, sideIdent, rowIndex, index, left, width, height, top, parent, lastRowOfModel }: ArgsRenderCellDiv): [HTMLDivElement, RendererCleanupFnType | undefined];
75
+ protected applyCssClasses(ele: HTMLDivElement, cssClasses?: {
76
+ [key: string]: boolean;
77
+ }): void;
78
+ rerenderCellContent({ area, rowIndex, columnIndex, value, cssClasses }: TableCellUpdateEventIf): void;
75
79
  protected getColumnWidths(startIndex: number, endIndex: number): number[];
76
80
  protected getRowHeights(startIndex: number, endIndex: number, areaModel: AreaModelIf): number[];
77
81
  protected adjustHoverRows(mouseMoveEvent: GeMouseEvent): void;
@@ -26,6 +26,7 @@ export declare class ConvenienceDomService {
26
26
  appendRelativeChildDiv(parent: HTMLDivElement): DivScope;
27
27
  appendText(parent: HTMLDivElement, text: string): HTMLElement;
28
28
  addClass(clazz: string, div: HTMLDivElement): HTMLDivElement;
29
+ removeClass(clazz: string, div: HTMLDivElement): HTMLDivElement;
29
30
  addClasses(classes: string[] | undefined, div: HTMLDivElement): HTMLDivElement;
30
31
  setAttribute(div: HTMLDivElement, key: string, value: string): HTMLDivElement;
31
32
  createAreaDivWithClass(clazz: string, parent: HTMLDivElement, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
@@ -1,6 +1,7 @@
1
1
  export interface DomServiceIf {
2
2
  setStyle(el: any, style: string, value: any): any;
3
3
  addClass(div: HTMLElement, clazz: string): HTMLDivElement;
4
+ removeClass(div: HTMLElement, clazz: string): HTMLDivElement;
4
5
  createElement<T>(ele: string): T;
5
6
  createText(text: string): HTMLElement;
6
7
  appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
@@ -3,6 +3,7 @@ export declare class SimpleDomService implements DomServiceIf {
3
3
  setStyle(el: any, style: string, value: any): any;
4
4
  appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
5
5
  addClass(div: HTMLDivElement, clazz: string): HTMLDivElement;
6
+ removeClass(div: HTMLDivElement, clazz: string): HTMLDivElement;
6
7
  appendChild(parent: HTMLElement, child: HTMLElement): void;
7
8
  createElement<T>(name: string): T;
8
9
  createText(value: string): any;
@@ -1,5 +1,5 @@
1
- import { TreeRow } from "../data/common/tree-row";
1
+ import { TreeRowIf } from "../data/common/tree-row-if";
2
2
  export declare class TreeRowService {
3
- flattenTree<T>(rows: TreeRow<T>[], ret?: TreeRow<T>[]): TreeRow<T>[];
4
- isVisible(row: TreeRow<any>): boolean;
3
+ flattenTree<T>(rows: TreeRowIf<T>[], ret?: TreeRowIf<T>[]): TreeRowIf<T>[];
4
+ isVisible(row: TreeRowIf<any>): boolean;
5
5
  }
@@ -4,7 +4,7 @@ import { TableCellUpdateEventIf } from "./data/common/event/input/table-cell-upd
4
4
  export declare class TableApi {
5
5
  private readonly tableScope;
6
6
  constructor(tableScope: TableScope);
7
- updateCells(events: TableCellUpdateEventIf[]): void;
7
+ updateCells(events: TableCellUpdateEventIf[], repaintAll?: boolean): void;
8
8
  externalFilterChanged(): void;
9
9
  scrollToPixel(_px?: number, _py?: number): void;
10
10
  scrollToIndex(_indexX?: number, _indexY?: number): void;
@@ -30,11 +30,12 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
30
30
  private mouseStartColumnIndex;
31
31
  private dragFrom;
32
32
  private dragTo;
33
+ static create(hostElement: HTMLDivElement, tableModel: TableModelIf, tableOptions?: TableOptionsIf, eventListener?: EventListenerIf, domService?: DomServiceIf): TableScope;
33
34
  constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, domService: DomServiceIf, tableOptions: TableOptionsIf, eventListener: EventListenerIf);
34
35
  onActionTriggered(actionId: ActionId): boolean;
35
36
  updateModelValueAfterEdit(areaIdent: AreaIdent, rowIndex: number, columnIndex: number, value: string): void;
36
37
  getApi(): TableApi;
37
- firstInit(): void;
38
+ firstInit(): TableScope;
38
39
  createGeMouseEvent(mouseEvent: MouseEvent): GeMouseEvent;
39
40
  onMouseDown(mouseEvent: GeMouseEvent): void;
40
41
  mouseDraggingOnFrame(mouseEvent: GeMouseEvent): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.0.13",
3
+ "version": "1.1.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0"
6
6
  },
@@ -11,7 +11,11 @@
11
11
  "entryFile": "src/index.ts"
12
12
  },
13
13
  "scripts": {
14
- "npm-pub:svelte-table": "npm publish --access public"
14
+ "typedoc:json": "npx typedoc --json ../../apps/table-website/src/assets/json/doctype.json src/index.ts",
15
+ "typedoc:docs-html": "npx typedoc --out ../../apps/table-website/src/assets/docs src/index.ts",
16
+ "typedoc:docs-html-custom-css": "npx typedoc --customCss ./doc.css --out ../../apps/table-website/src/assets/docs src/index.ts",
17
+ "typedoc:docs-md": "npx typedoc --plugin typedoc-plugin-markdown --out ../../apps/table-website/src/assets/docsmd src/index.ts",
18
+ "npm-pub:table": "npm publish --access public"
15
19
  },
16
20
  "exports": {
17
21
  ".": {
@@ -20,3 +24,4 @@
20
24
  }
21
25
  }
22
26
  }
27
+