@sme.up/ketchup2 2.0.0-SNAPSHOT-20250618125320 → 2.0.0-SNAPSHOT-20250620100358
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/dist/assets/testAsset.d.ts +1 -1
- package/dist/components/data-table/assets/data-table-shapes.d.ts +1 -1
- package/dist/components/data-table/data-table-types.d.ts +4 -0
- package/dist/components/data-table/data-table-types.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/hooks/useColumnWidths.d.ts +28 -0
- package/dist/components/data-table/hooks/useColumnWidths.d.ts.map +1 -0
- package/dist/functional-components/footer/footer-types.d.ts +6 -0
- package/dist/functional-components/footer/footer-types.d.ts.map +1 -0
- package/dist/functional-components/footer/footer.d.ts +4 -0
- package/dist/functional-components/footer/footer.d.ts.map +1 -0
- package/dist/functional-components/group-bar/group-bar.d.ts.map +1 -1
- package/dist/functional-components/row/row.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +13 -13
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +1299 -1273
- package/dist/utils/hash.d.ts +1 -1
- package/dist/utils/hash.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ export declare const generateMockedOptions: (multiplier: number) => DataCellOpti
|
|
|
3
3
|
export declare const generateRows: (count: number) => {
|
|
4
4
|
layout: {};
|
|
5
5
|
rowId: string;
|
|
6
|
-
error: null;
|
|
7
6
|
cells: {
|
|
8
7
|
ACP: {
|
|
9
8
|
decode: string;
|
|
@@ -155,6 +154,7 @@ export declare const generateRows: (count: number) => {
|
|
|
155
154
|
data: {
|
|
156
155
|
sizeX: string;
|
|
157
156
|
};
|
|
157
|
+
isEditable: boolean;
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
160
|
}[];
|
|
@@ -9,7 +9,6 @@ export declare const shapesData: {
|
|
|
9
9
|
rows: {
|
|
10
10
|
layout: {};
|
|
11
11
|
rowId: string;
|
|
12
|
-
error: null;
|
|
13
12
|
cells: {
|
|
14
13
|
ACP: {
|
|
15
14
|
decode: string;
|
|
@@ -161,6 +160,7 @@ export declare const shapesData: {
|
|
|
161
160
|
data: {
|
|
162
161
|
sizeX: string;
|
|
163
162
|
};
|
|
163
|
+
isEditable: boolean;
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
166
|
}[];
|
|
@@ -22,6 +22,10 @@ export interface DataTableProps {
|
|
|
22
22
|
readonly groups?: smeupGroup[];
|
|
23
23
|
columnSizingMode?: ColumnSizingMode;
|
|
24
24
|
showGroupBar?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description When true, if isEditable is undefined, it'll force the cell isEditable state to true
|
|
27
|
+
*/
|
|
28
|
+
isEditable?: boolean;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* @interface InternalDataTable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-types.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-types.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACX,MAAM,6BAA6B,CAAA;AAEpC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IAExB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;IAE9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IAEnC,YAAY,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"data-table-types.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-types.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,E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.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAU1D,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAU1D,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAA;AAKtE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA6NvD,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataColumn, DataRow } from '../../../types/data-structures';
|
|
2
|
+
interface UseColumnWidthsProps {
|
|
3
|
+
columns: DataColumn[];
|
|
4
|
+
rows: DataRow[];
|
|
5
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
6
|
+
sizingMode: "fixed" | "fit-grid" | "fit-content";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook to calculate and manage column widths for a data table component.
|
|
10
|
+
*
|
|
11
|
+
* Supports three sizing modes:
|
|
12
|
+
* - `"fixed"`: All columns have a fixed width.
|
|
13
|
+
* - `"fit-grid"`: Columns are sized to evenly fill the container width.
|
|
14
|
+
* - `"fit-content"`: Columns are sized based on the maximum content or header length.
|
|
15
|
+
*
|
|
16
|
+
* @param params - The parameters for the hook.
|
|
17
|
+
* @param params.columns - Array of column definitions, each with a `name`, `title`, and optional `visible` property.
|
|
18
|
+
* @param params.rows - Array of row data, where each row contains a `cells` object mapping column names to cell values.
|
|
19
|
+
* @param params.containerRef - React ref to the container DOM element, used to determine available width.
|
|
20
|
+
* @param params.sizingMode - The sizing mode to use: `"fixed"`, `"fit-grid"`, or `"fit-content"`.
|
|
21
|
+
*
|
|
22
|
+
* @returns A tuple containing:
|
|
23
|
+
* - `columnWidths`: An object mapping column names to their calculated widths in pixels.
|
|
24
|
+
* - `setColumnWidths`: A React state setter to manually update column widths.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useColumnWidths: ({ columns, rows, containerRef, sizingMode, }: UseColumnWidthsProps) => [Record<string, number>, React.Dispatch<React.SetStateAction<Record<string, number>>>];
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=useColumnWidths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnWidths.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/hooks/useColumnWidths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAEpE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACjD,UAAU,EAAE,OAAO,GAAG,UAAU,GAAG,aAAa,CAAA;CACjD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,GAAI,8CAK7B,oBAAoB,KAAG,CACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAqC7D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer-types.d.ts","sourceRoot":"","sources":["../../../src/functional-components/footer/footer-types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/functional-components/footer/footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqBxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-bar.d.ts","sourceRoot":"","sources":["../../../src/functional-components/group-bar/group-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD,OAAO,iBAAiB,CAAA;AAGxB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"group-bar.d.ts","sourceRoot":"","sources":["../../../src/functional-components/group-bar/group-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD,OAAO,iBAAiB,CAAA;AAGxB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkC5C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/functional-components/row/row.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAyB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/functional-components/row/row.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAyB,MAAM,aAAa,CAAA;AAK7D,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAoIlC,CAAA"}
|