@simoncomputing/mui-bueno-v2 0.14.10 → 0.15.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.
- package/CHANGELOG.md +9 -0
- package/dist/@types/index.d.ts +12 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
- Minor increment --> singlular/minor changes. Minimal breaking changes.
|
|
12
12
|
- Patch increment --> singlular/minor changes. Zero breaking changes.
|
|
13
13
|
|
|
14
|
+
## [0.15.0] - 2025-07-10
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `Table`/`PaginatedTable`: Improved type-safety of `TableConfig` & `TableColumn`.
|
|
19
|
+
- Migration:
|
|
20
|
+
- You may need to explicitly define your `Table`'s type (ex. `<Table<User> ...>` instead of `<Table ...>`). The same goes for `TableConfig` if you initialize it separately.
|
|
21
|
+
- You may need to update your generic props of `TableColumn` if you initialize it separately (ex. `TableColumn<User, 'isActive'>` instead of `TableColumn<User, boolean>`)
|
|
22
|
+
|
|
14
23
|
## [0.14.10] - 2025-07-03
|
|
15
24
|
|
|
16
25
|
### Fixed
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export type EnvironmentInfo = {
|
|
|
103
103
|
/**
|
|
104
104
|
* TableColumn represents a column in a table where `K` represents a property of `T`
|
|
105
105
|
* EXAMPLE: For a table of users, this would be the `TableColumn` defintion for the
|
|
106
|
-
* phone number column: TableColumn<User,
|
|
106
|
+
* phone number column: TableColumn<User, 'phoneNumber'>.
|
|
107
107
|
*
|
|
108
108
|
* @property {string} label - Label that will display in the Table header for the column
|
|
109
109
|
* @property {string} fieldName - Property name of the object
|
|
@@ -114,20 +114,25 @@ export type EnvironmentInfo = {
|
|
|
114
114
|
* on a phone vs tablet/desktop
|
|
115
115
|
* @property {string} sortName - (Optional) Passed instead of `fieldName` to onSortChange(fieldName, ...). Useful if you're rendering the same object in 2+ columns and need a way to differentiate when sorting.
|
|
116
116
|
*/
|
|
117
|
-
export type TableColumn<T, K> = {
|
|
117
|
+
export type TableColumn<T, K extends keyof T> = {
|
|
118
118
|
key?: string;
|
|
119
119
|
label?: string;
|
|
120
|
-
fieldName:
|
|
121
|
-
render?: (value: K, object: T, isMobile: boolean) => React.ReactNode;
|
|
120
|
+
fieldName: K;
|
|
121
|
+
render?: (value: T[K], object: T, isMobile: boolean) => React.ReactNode;
|
|
122
122
|
sortName?: string;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// Sort order for Tables
|
|
126
126
|
export type SortOrder = 'asc' | 'desc';
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Defines array of of TableColumns, where the type of each TableColumn matches one of the properties of T (ex. `User`)
|
|
130
|
+
*/
|
|
131
|
+
export type TableConfig<T> = Array<
|
|
132
|
+
{
|
|
133
|
+
[K in keyof T]: TableColumnWithKey<T, K>;
|
|
134
|
+
}[keyof T]
|
|
135
|
+
>;
|
|
131
136
|
|
|
132
137
|
/**
|
|
133
138
|
* Convenience Interface for autocomplete dropdown options
|