@guiexpert/table 1.1.49 → 1.1.51

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.
@@ -1,5 +1,5 @@
1
1
  import { SizeIf } from "../../common/size.if";
2
- import { ColumnDefIf } from "./column-def.if";
2
+ import { ColumnDefIf, ValueRowSortComparator } from "./column-def.if";
3
3
  import { CellRendererIf } from "../../../renderer/cell-render.if";
4
4
  import { AreaObjectMapType } from "../../common/area-map.type";
5
5
  import { AreaObjectMap } from "../../common/area-map";
@@ -19,7 +19,7 @@ export declare class ColumnDef implements ColumnDefIf {
19
19
  minWidth: SizeIf;
20
20
  maxWidth: SizeIf;
21
21
  sortable?: BooleanFunction | undefined;
22
- sortComparator?: (<T>(a: T, b: T) => number) | undefined;
22
+ sortComparator?: ValueRowSortComparator | undefined;
23
23
  sortState?: SortState | undefined;
24
24
  sortStatesOrder?: SortState[] | undefined;
25
25
  sortIconVisible?: BooleanFunction | undefined;
@@ -28,7 +28,7 @@ export declare class ColumnDef implements ColumnDefIf {
28
28
  editInputPipe?: editInputPipe | undefined;
29
29
  isVisible: BooleanFunction;
30
30
  visible: boolean;
31
- constructor(property: string, headerLabel: string, width?: SizeIf, classes?: AreaObjectMapType<string[]>, rendererMap?: AreaObjectMapType<CellRendererIf>, minWidth?: SizeIf, maxWidth?: SizeIf, sortable?: BooleanFunction | undefined, sortComparator?: (<T>(a: T, b: T) => number) | undefined, sortState?: SortState | undefined, sortStatesOrder?: SortState[] | undefined, sortIconVisible?: BooleanFunction | undefined, editable?: BooleanFunction | undefined, getEditRenderer?: GetEditRenderer | undefined, editInputPipe?: editInputPipe | undefined, isVisible?: BooleanFunction);
31
+ constructor(property: string, headerLabel: string, width?: SizeIf, classes?: AreaObjectMapType<string[]>, rendererMap?: AreaObjectMapType<CellRendererIf>, minWidth?: SizeIf, maxWidth?: SizeIf, sortable?: BooleanFunction | undefined, sortComparator?: ValueRowSortComparator | undefined, sortState?: SortState | undefined, sortStatesOrder?: SortState[] | undefined, sortIconVisible?: BooleanFunction | undefined, editable?: BooleanFunction | undefined, getEditRenderer?: GetEditRenderer | undefined, editInputPipe?: editInputPipe | undefined, isVisible?: BooleanFunction);
32
32
  static bodyRenderer(bodyRenderer: CellRendererIf): AreaObjectMap<CellRendererIf>;
33
33
  static create(param: {
34
34
  property?: string;
@@ -44,7 +44,7 @@ export declare class ColumnDef implements ColumnDefIf {
44
44
  footerClasses?: string[];
45
45
  sortable?: BooleanFunction;
46
46
  sortIconVisible?: BooleanFunction;
47
- sortComparator?: <T>(a: T, b: T) => number;
47
+ sortComparator?: ValueRowSortComparator;
48
48
  sortState?: SortState;
49
49
  sortStatesOrder?: SortState[];
50
50
  editable?: BooleanFunction;
@@ -5,6 +5,25 @@ import { BooleanFunction } from "../../common/boolean-function";
5
5
  import { SortState } from "../../common/sort-state.type";
6
6
  import { GetEditRenderer } from "../../../renderer/edit/edit-cell-renderer.type";
7
7
  import { editInputPipe } from "../../../renderer/edit/edit-input-pipe.if";
8
+ /**
9
+ * Represents a function that compares two values for sorting purposes.
10
+ * The function takes two values of type T and optionally their corresponding row objects of type U,
11
+ * compares them, and returns a number.
12
+ * If the result is negative, it means 'valueA' comes before 'valueB' in the sorted order.
13
+ * If the result is positive, it means 'valueB' comes before 'valueA' in the sorted order.
14
+ * If the result is zero, it means the two values are considered equal for sorting purposes.
15
+ *
16
+ * @typeparam T The type of values being compared.
17
+ * @typeparam U The type of row objects that contain the values.
18
+ *
19
+ * @param valueA The first value to be compared.
20
+ * @param valueB The second value to be compared.
21
+ * @param rowA Optional. The row object containing valueA.
22
+ * @param rowB Optional. The row object containing valueB.
23
+ *
24
+ * @returns A number indicating the relative order of 'valueA' and 'valueB'.
25
+ */
26
+ export type ValueRowSortComparator = <T, U>(valueA: T, valueB: T, rowA?: U, rowB?: U) => number;
8
27
  /**
9
28
  * Represents a column definition of one table column.
10
29
  */
@@ -69,19 +88,15 @@ export interface ColumnDefIf {
69
88
  sortIconVisible?: BooleanFunction;
70
89
  /**
71
90
  * Represents a function that compares two values for sorting purposes.
72
- * The function takes two arguments of type T, compares them, and returns a number.
73
- * If the result is negative, it means 'a' comes before 'b' in the sorted order.
74
- * If the result is positive, it means 'b' comes before 'a' in the sorted order.
91
+ * The function takes two values and optionally their corresponding row objects,
92
+ * compares them, and returns a number.
93
+ * If the result is negative, it means 'valueA' comes before 'valueB' in the sorted order.
94
+ * If the result is positive, it means 'valueB' comes before 'valueA' in the sorted order.
75
95
  * If the result is zero, it means the two values are considered equal for sorting purposes.
76
96
  *
77
- * @typeparam T The type of values being compared.
78
- *
79
- * @param a The first value to be compared.
80
- * @param b The second value to be compared.
81
- *
82
- * @returns A number indicating the relative order of 'a' and 'b'.
97
+ * @see ValueRowSortComparator
83
98
  */
84
- sortComparator?: <T>(a: T, b: T) => number;
99
+ sortComparator?: ValueRowSortComparator;
85
100
  /**
86
101
  * Represents the state of sorting for a list.
87
102
  *
@@ -0,0 +1,5 @@
1
+ import { EventAdapter } from './event-adapter';
2
+ export declare class EventCheckboxChangedHandler extends EventAdapter {
3
+ private readonly onCheckboxChangedCallback;
4
+ constructor(onCheckboxChangedCallback: (evt: any[]) => void);
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./index.js",