coles-solid-library 0.3.3 → 0.3.5
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/components/Form/formGroup.d.ts +7 -0
- package/dist/components/TableV2/row.d.ts +2 -1
- package/dist/components/TableV2/table.d.ts +8 -0
- package/dist/components/TableV2/tableProvider.d.ts +25 -18
- package/dist/index.esm.js +470 -323
- package/package.json +13 -3
- package/dist/components/TableV2/droprow.d.ts +0 -9
- package/dist/components/TableV2/formArrayTable.d.ts +0 -18
- package/dist/components/popup/popup.component.d.ts +0 -24
|
@@ -25,6 +25,13 @@ export declare class FormGroup<T extends object> {
|
|
|
25
25
|
*/
|
|
26
26
|
get(): T;
|
|
27
27
|
get<K extends keyof T>(key: K): T[K];
|
|
28
|
+
/**
|
|
29
|
+
* Gets the current value of a specific control.
|
|
30
|
+
* without cloning the value
|
|
31
|
+
* @param key - The key of the control to retrieve.
|
|
32
|
+
* @returns The value of the specified control.
|
|
33
|
+
*/
|
|
34
|
+
getR<K extends keyof T>(key: K): T[K];
|
|
28
35
|
/**
|
|
29
36
|
* Gets a specific item from a FormArray at the given index
|
|
30
37
|
*
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { JSX } from "solid-js";
|
|
2
|
-
interface BaseRowProps extends JSX.HTMLAttributes<HTMLTableRowElement> {
|
|
2
|
+
interface BaseRowProps extends Omit<JSX.HTMLAttributes<HTMLTableRowElement>, 'onClick'> {
|
|
3
3
|
children?: JSX.Element[];
|
|
4
4
|
rowNumber?: number;
|
|
5
5
|
class?: string;
|
|
6
6
|
style?: JSX.CSSProperties;
|
|
7
|
+
onClick?: ((e: MouseEvent) => void) | ((e: MouseEvent, item: any) => void);
|
|
7
8
|
}
|
|
8
9
|
interface HeaderRowProps extends BaseRowProps {
|
|
9
10
|
header?: true | undefined;
|
|
@@ -14,6 +14,14 @@ interface TableProps<T = any> {
|
|
|
14
14
|
tfoot?: StyleContainer<JSX.HTMLAttributes<HTMLTableSectionElement>>;
|
|
15
15
|
colGroup?: StyleContainer<JSX.ColgroupHTMLAttributes<HTMLTableColElement>>;
|
|
16
16
|
};
|
|
17
|
+
/** Provide a stable key for a data/index combination to persist dropdown state across resorting */
|
|
18
|
+
getRowKey?: (dataItem: T, dataIndex: number) => string | number | undefined;
|
|
19
|
+
/** Called when a cell renderer throws. Return a fallback element to override default. */
|
|
20
|
+
onCellError?: (err: unknown, context: {
|
|
21
|
+
column?: string;
|
|
22
|
+
row: number;
|
|
23
|
+
dataIndex: number;
|
|
24
|
+
}) => JSX.Element | void;
|
|
17
25
|
}
|
|
18
26
|
export declare const Table: <T>(props: TableProps<T>) => JSX.Element;
|
|
19
27
|
export {};
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface StyleContainer<T
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
export interface StyleContainer<T extends Record<string, any>> {
|
|
3
3
|
class?: string;
|
|
4
4
|
style?: JSX.CSSProperties | string;
|
|
5
5
|
all?: T;
|
|
6
6
|
}
|
|
7
|
+
export type ColumnName = string;
|
|
8
|
+
export type RowIndex = string;
|
|
7
9
|
export interface HeadStyle {
|
|
8
|
-
[colName:
|
|
9
|
-
[rowIndex:
|
|
10
|
+
[colName: ColumnName]: {
|
|
11
|
+
[rowIndex: RowIndex]: StyleContainer<JSX.ThHTMLAttributes<HTMLTableCellElement>>;
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
14
|
export interface HeadRowStyle {
|
|
13
|
-
[rowIndex:
|
|
15
|
+
[rowIndex: RowIndex]: StyleContainer<JSX.HTMLAttributes<HTMLTableRowElement>>;
|
|
14
16
|
}
|
|
15
17
|
export interface HeaderOrganized {
|
|
16
|
-
[headIndex:
|
|
18
|
+
[headIndex: RowIndex]: HeaderStorage;
|
|
17
19
|
}
|
|
18
20
|
export interface HeaderStorage {
|
|
19
21
|
[name: string]: JSX.Element;
|
|
20
22
|
}
|
|
23
|
+
export interface ExtendedRowHTMLAttributes extends JSX.HTMLAttributes<HTMLTableRowElement> {
|
|
24
|
+
isDropHeader?: boolean;
|
|
25
|
+
isDropRow?: boolean;
|
|
26
|
+
}
|
|
21
27
|
export interface RowStyle {
|
|
22
|
-
[rowIndex:
|
|
28
|
+
[rowIndex: RowIndex]: StyleContainer<ExtendedRowHTMLAttributes>;
|
|
23
29
|
}
|
|
24
30
|
export interface CellRowStyle {
|
|
25
|
-
[rowIndex:
|
|
26
|
-
[colName:
|
|
31
|
+
[rowIndex: RowIndex]: {
|
|
32
|
+
[colName: ColumnName]: StyleContainer<JSX.TdHTMLAttributes<HTMLTableCellElement>>;
|
|
27
33
|
};
|
|
28
34
|
}
|
|
29
35
|
export interface IRow<T> {
|
|
@@ -32,28 +38,27 @@ export interface IRow<T> {
|
|
|
32
38
|
dropHeader?: boolean;
|
|
33
39
|
}
|
|
34
40
|
export interface RowStorage<T> {
|
|
35
|
-
[name:
|
|
41
|
+
[name: ColumnName]: IRow<T>;
|
|
36
42
|
}
|
|
37
43
|
export interface RowOrganized<T> {
|
|
38
|
-
[rowIndex:
|
|
44
|
+
[rowIndex: RowIndex]: RowStorage<T>;
|
|
39
45
|
}
|
|
40
46
|
export interface ShoeBox {
|
|
41
|
-
[rowIndex:
|
|
47
|
+
[rowIndex: RowIndex]: StyleContainer<JSX.HTMLAttributes<HTMLTableRowElement>>;
|
|
42
48
|
}
|
|
43
49
|
export interface Socks {
|
|
44
|
-
[name:
|
|
50
|
+
[name: ColumnName]: JSX.Element;
|
|
45
51
|
}
|
|
46
52
|
export interface SockDrawer {
|
|
47
|
-
[rowIndex:
|
|
53
|
+
[rowIndex: RowIndex]: Socks;
|
|
48
54
|
}
|
|
49
55
|
export interface ColumnStyle {
|
|
50
|
-
[colName:
|
|
56
|
+
[colName: ColumnName]: StyleContainer<JSX.ColHTMLAttributes<HTMLTableColElement>>;
|
|
51
57
|
}
|
|
52
58
|
export interface ColumnGroupStyle {
|
|
53
|
-
[colName:
|
|
59
|
+
[colName: ColumnName]: StyleContainer<JSX.ColgroupHTMLAttributes<HTMLTableColElement>>;
|
|
54
60
|
}
|
|
55
61
|
export interface TableContext<T = any> {
|
|
56
|
-
refresh: Accessor<boolean>;
|
|
57
62
|
getDataSource: () => T[];
|
|
58
63
|
setDataSource: (data: T[]) => any;
|
|
59
64
|
addHeaderCell: (name: string, index: number, header: JSX.Element) => void;
|
|
@@ -66,9 +71,11 @@ export interface TableContext<T = any> {
|
|
|
66
71
|
addHeaderStyle: (name: string, index: number, style: StyleContainer<JSX.ThHTMLAttributes<HTMLTableCellElement>>) => void;
|
|
67
72
|
addCellStyle: (rowIndex: number, colName: string, style: StyleContainer<JSX.TdHTMLAttributes<HTMLTableCellElement>>) => void;
|
|
68
73
|
addFootCellStyle: (rowIndex: number, colName: string, style: StyleContainer<JSX.TdHTMLAttributes<HTMLTableCellElement>>) => void;
|
|
69
|
-
addRowStyle: (index: number, style: StyleContainer<
|
|
74
|
+
addRowStyle: (index: number, style: StyleContainer<ExtendedRowHTMLAttributes>, isDroprow?: boolean, isDropHeader?: boolean) => void;
|
|
70
75
|
addFooterRowStyle: (index: number, style: StyleContainer<JSX.HTMLAttributes<HTMLTableRowElement>>) => void;
|
|
71
76
|
addHeaderRowStyle: (index: number, style: StyleContainer<JSX.HTMLAttributes<HTMLTableRowElement>>) => void;
|
|
77
|
+
/** Optional external row identity mapping for stable state retention (e.g., dropdown open) when data reorders */
|
|
78
|
+
getRowKey?: (rowIndex: number, dataItem: T, dataIndex: number) => string | number | undefined;
|
|
72
79
|
}
|
|
73
80
|
export declare function useTableContext<T>(): TableContext<T>;
|
|
74
81
|
interface TableProviderProps<T> extends TableContext<T> {
|