@etsoo/react 1.3.98 → 1.3.99

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.
@@ -19,7 +19,7 @@ export interface DnDListProps<D extends {}, E extends React.ElementType> {
19
19
  /**
20
20
  * Get list item style callback
21
21
  */
22
- getItemStyle?: (isDragging: boolean) => CSSProperties;
22
+ getItemStyle?: (isDragging: boolean, index: number) => CSSProperties;
23
23
  /**
24
24
  * Get list style callback
25
25
  */
package/lib/mu/DnDList.js CHANGED
@@ -79,7 +79,7 @@ export function DnDList(props) {
79
79
  if (id == null)
80
80
  return;
81
81
  return (React.createElement(Draggable, { key: id, draggableId: id, index: index }, (provided, snapshot) => (React.createElement("div", { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, style: {
82
- ...getItemStyle(snapshot.isDragging),
82
+ ...getItemStyle(snapshot.isDragging, index),
83
83
  ...provided
84
84
  .draggableProps
85
85
  .style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.98",
3
+ "version": "1.3.99",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -34,7 +34,7 @@ export interface DnDListProps<D extends {}, E extends React.ElementType> {
34
34
  /**
35
35
  * Get list item style callback
36
36
  */
37
- getItemStyle?: (isDragging: boolean) => CSSProperties;
37
+ getItemStyle?: (isDragging: boolean, index: number) => CSSProperties;
38
38
 
39
39
  /**
40
40
  * Get list style callback
@@ -201,7 +201,8 @@ export function DnDList<
201
201
  {...provided.dragHandleProps}
202
202
  style={{
203
203
  ...getItemStyle(
204
- snapshot.isDragging
204
+ snapshot.isDragging,
205
+ index
205
206
  ),
206
207
  ...provided
207
208
  .draggableProps