@guiexpert/table 1.1.27 → 1.1.28
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.
- package/index.cjs +18 -18
- package/index.d.ts +1 -0
- package/index.js +218 -175
- package/lib/table/data/common/size-unit.type.d.ts +9 -0
- package/lib/table/data/common/size.d.ts +3 -2
- package/lib/table/data/common/size.if.d.ts +3 -3
- package/lib/table/data/tablemodel/table-model.d.ts +12 -2
- package/lib/table/data/tablemodel/table-model.if.d.ts +8 -0
- package/lib/table/render-scope.d.ts +8 -0
- package/lib/table/table-api.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the possible unit types for specifying size.
|
|
3
|
+
* 'px': width in pixel
|
|
4
|
+
* '%': width in percentage of container width
|
|
5
|
+
* 'weight': after the width is set for columns with unit 'px' and '%', the remaining width is divided among the weighted columns according to their respective weighting.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {"px" | "%" | "weight"} SizeUnitType
|
|
8
|
+
*/
|
|
9
|
+
export type SizeUnitType = "px" | "%" | "weight";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SizeIf } from "./size.if";
|
|
2
|
+
import { SizeUnitType } from './size-unit.type';
|
|
2
3
|
export declare class Size implements SizeIf {
|
|
3
4
|
value: number;
|
|
4
|
-
unit:
|
|
5
|
-
constructor(value?: number, unit?:
|
|
5
|
+
unit: SizeUnitType;
|
|
6
|
+
constructor(value?: number, unit?: SizeUnitType);
|
|
6
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { SizeUnitType } from './size-unit.type';
|
|
1
2
|
/**
|
|
2
|
-
* Represents
|
|
3
|
-
* @interface
|
|
3
|
+
* Represents the size of an object or element.
|
|
4
4
|
*/
|
|
5
5
|
export interface SizeIf {
|
|
6
6
|
value: number;
|
|
7
|
-
unit:
|
|
7
|
+
unit: SizeUnitType;
|
|
8
8
|
}
|
|
@@ -48,9 +48,10 @@ export declare class TableModel implements TableModelIf {
|
|
|
48
48
|
protected contentWidthInPx: number;
|
|
49
49
|
protected padding: Padding;
|
|
50
50
|
protected xPositions: number[];
|
|
51
|
-
constructor(headerAreaModel: AreaModelIf, bodyAreaModel: AreaModelIf, footerAreaModel: AreaModelIf, fixedLeftColumnCount?: number, fixedRightColumnCount?: number, rowCheckboxVisible?: boolean, defaultRowHeights?: DefaultRowHeightsIf, columnDefs?: ColumnDefIf[], columnSizes?: number[], overridingColumnWidth?: number, columnCount?: number, parentSize?: number, // can be important when we have percentage
|
|
51
|
+
constructor(headerAreaModel: AreaModelIf, bodyAreaModel: AreaModelIf, footerAreaModel: AreaModelIf, fixedLeftColumnCount?: number, fixedRightColumnCount?: number, rowCheckboxVisible?: boolean, defaultRowHeights?: DefaultRowHeightsIf, columnDefs?: ColumnDefIf[], columnSizes?: number[], overridingColumnWidth?: number, columnCount?: number, parentSize?: number, // can be important when we have percentage widths,
|
|
52
52
|
getSelectionModel?: GetT<SelectionModelIf>);
|
|
53
53
|
init(): void;
|
|
54
|
+
setParentWidth(widthInPixel: number): void;
|
|
54
55
|
/**
|
|
55
56
|
* Retrieves the count of columns in the current instance.
|
|
56
57
|
*
|
|
@@ -267,7 +268,16 @@ export declare class TableModel implements TableModelIf {
|
|
|
267
268
|
* @returns {void}
|
|
268
269
|
*/
|
|
269
270
|
changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
|
|
270
|
-
private
|
|
271
|
+
private recalcColumnWidths;
|
|
272
|
+
/**
|
|
273
|
+
* Converts the given `SizeIf` object to pixel units based on the provided `clientWidth`.
|
|
274
|
+
* The given `SizeIf` must have the uniit '%' or 'px'.
|
|
275
|
+
*
|
|
276
|
+
* @param {SizeIf} width - The size object to be converted.
|
|
277
|
+
* @param {number} clientWidth - The width of the client area in pixels.
|
|
278
|
+
* @return {number} - The converted size value in pixels. returns -1 if unit is not '%' or 'px'.
|
|
279
|
+
*/
|
|
280
|
+
private sizeToPixel;
|
|
271
281
|
private arrayMove;
|
|
272
282
|
private recalcContentWidthInPx;
|
|
273
283
|
private calcXPositions;
|
|
@@ -44,6 +44,14 @@ export interface TableModelIf {
|
|
|
44
44
|
* Triggered by TableScope.firstInit() after the table tag is attached to the dom.
|
|
45
45
|
*/
|
|
46
46
|
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Recalculates the column widths of the table.
|
|
49
|
+
*
|
|
50
|
+
* @param {number} [clientWidth] - The client width of the table. If not provided, the client width of the scroll viewport will be used.
|
|
51
|
+
*
|
|
52
|
+
* @return {undefined}
|
|
53
|
+
*/
|
|
54
|
+
setParentWidth(widthInPixel: number): void;
|
|
47
55
|
/**
|
|
48
56
|
* Returns the number of columns in a dataset.
|
|
49
57
|
*
|
|
@@ -85,6 +85,14 @@ export declare class RenderScope extends EleScope {
|
|
|
85
85
|
* @return {void} This method does not return any value.
|
|
86
86
|
*/
|
|
87
87
|
repaintHard(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Recalculates the column widths of the table.
|
|
90
|
+
*
|
|
91
|
+
* @param {number} [clientWidth] - The client width of the table. If not provided, the client width of the scroll viewport will be used.
|
|
92
|
+
*
|
|
93
|
+
* @return {undefined}
|
|
94
|
+
*/
|
|
95
|
+
recalcColumnWidths(clientWidth?: number): void;
|
|
88
96
|
/**
|
|
89
97
|
* Adjusts the table after scrolling. This method performs various adjustments
|
|
90
98
|
* to the table's appearance and behavior after a scroll event occurs.
|
package/lib/table/table-api.d.ts
CHANGED