@react-types/table 3.7.1-nightly.4028 → 3.7.1-nightly.4036

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.d.ts +11 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/table",
3
- "version": "3.7.1-nightly.4028+62a6f1756",
3
+ "version": "3.7.1-nightly.4036+e4bc3269f",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,8 +9,8 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/grid": "3.1.9-nightly.4028+62a6f1756",
13
- "@react-types/shared": "3.0.0-nightly.2323+62a6f1756"
12
+ "@react-types/grid": "3.1.9-nightly.4036+e4bc3269f",
13
+ "@react-types/shared": "3.0.0-nightly.2331+e4bc3269f"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -18,5 +18,5 @@
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
- "gitHead": "62a6f1756e97715a6a087a8f9ceff7d1a2285057"
21
+ "gitHead": "e4bc3269fa41aa096700445c6bfa9c8620545e6a"
22
22
  }
package/src/index.d.ts CHANGED
@@ -122,20 +122,25 @@ export interface SpectrumColumnProps<T> extends ColumnProps<T> {
122
122
  hideHeader?: boolean
123
123
  }
124
124
 
125
- export type RowElement = ReactElement<RowProps>;
125
+ export type RowElement<T> = ReactElement<RowProps<T>>;
126
126
  export interface TableBodyProps<T> extends Omit<AsyncLoadable, 'isLoading'> {
127
127
  /** The contents of the table body. Supports static items or a function for dynamic rendering. */
128
- children: RowElement | RowElement[] | ((item: T) => RowElement),
128
+ children: RowElement<T> | RowElement<T>[] | ((item: T) => RowElement<T>),
129
129
  /** A list of row objects in the table body used when dynamically rendering rows. */
130
130
  items?: Iterable<T>,
131
131
  /** The current loading state of the table. */
132
132
  loadingState?: LoadingState
133
133
  }
134
134
 
135
- export interface RowProps {
136
- // treeble case? Unsupported props for now
137
- // /** A list of child item objects used when dynamically rendering row children. */
138
- // childItems?: Iterable<T>,
135
+ export interface RowProps<T> {
136
+ /**
137
+ * A list of child item objects used when dynamically rendering row children. Requires the feature flag to be
138
+ * enabled along with UNSTABLE_allowsExpandableRows, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.
139
+ * @version alpha
140
+ * @private
141
+ */
142
+ UNSTABLE_childItems?: Iterable<T>,
143
+ // TODO: update when async loading is supported for expandable rows
139
144
  // /** Whether this row has children, even if not loaded yet. */
140
145
  // hasChildItems?: boolean,
141
146
  /** Rendered contents of the row or row child items. */