@etsoo/materialui 1.1.8 → 1.1.10

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/lib/DnDList.js CHANGED
@@ -167,13 +167,16 @@ export function DnDList(props) {
167
167
  React.useEffect(() => {
168
168
  setItems(props.items);
169
169
  }, [props.items]);
170
- return (React.createElement("div", { ref: (div) => {
171
- if (div)
172
- setupDiv(div);
173
- } },
174
- React.createElement(DndContext, { onDragStart: handleDragStart, onDragEnd: handleDragEnd },
175
- React.createElement(SortableContext, { items: items, strategy: verticalListSortingStrategy }, items.map((item, index) => {
176
- const id = item[keyField];
177
- return (React.createElement(SortableItem, { id: id, key: id, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }));
178
- })))));
170
+ const children = (React.createElement(DndContext, { onDragStart: handleDragStart, onDragEnd: handleDragEnd },
171
+ React.createElement(SortableContext, { items: items, strategy: verticalListSortingStrategy }, items.map((item, index) => {
172
+ const id = item[keyField];
173
+ return (React.createElement(SortableItem, { id: id, key: id, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }));
174
+ }))));
175
+ if (onFormChange) {
176
+ return (React.createElement("div", { style: { width: "100%" }, ref: (div) => {
177
+ if (div)
178
+ setupDiv(div);
179
+ } }, children));
180
+ }
181
+ return children;
179
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -55,7 +55,7 @@
55
55
  "@etsoo/react": "^1.6.42",
56
56
  "@etsoo/shared": "^1.1.88",
57
57
  "@mui/icons-material": "^5.11.0",
58
- "@mui/material": "^5.11.4",
58
+ "@mui/material": "^5.11.5",
59
59
  "@types/pica": "^9.0.1",
60
60
  "@types/pulltorefreshjs": "^0.1.5",
61
61
  "@types/react": "^18.0.26",
@@ -84,8 +84,8 @@
84
84
  "@testing-library/jest-dom": "^5.16.5",
85
85
  "@testing-library/react": "^13.4.0",
86
86
  "@types/jest": "^29.2.5",
87
- "@typescript-eslint/eslint-plugin": "^5.48.1",
88
- "@typescript-eslint/parser": "^5.48.1",
87
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
88
+ "@typescript-eslint/parser": "^5.48.2",
89
89
  "jest": "^29.3.1",
90
90
  "jest-environment-jsdom": "^29.3.1",
91
91
  "typescript": "^4.9.4"
package/src/DnDList.tsx CHANGED
@@ -357,29 +357,38 @@ export function DnDList<
357
357
  setItems(props.items);
358
358
  }, [props.items]);
359
359
 
360
- return (
361
- <div
362
- ref={(div) => {
363
- if (div) setupDiv(div);
364
- }}
365
- >
366
- <DndContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
367
- <SortableContext items={items} strategy={verticalListSortingStrategy}>
368
- {items.map((item, index) => {
369
- const id = item[keyField] as unknown as UniqueIdentifier;
370
- return (
371
- <SortableItem
372
- id={id}
373
- key={id}
374
- style={getItemStyle!(index, id === activeId)}
375
- itemRenderer={(nodeRef, actionNodeRef) =>
376
- itemRenderer(item, index, nodeRef, actionNodeRef)
377
- }
378
- />
379
- );
380
- })}
381
- </SortableContext>
382
- </DndContext>
383
- </div>
360
+ const children = (
361
+ <DndContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
362
+ <SortableContext items={items} strategy={verticalListSortingStrategy}>
363
+ {items.map((item, index) => {
364
+ const id = item[keyField] as unknown as UniqueIdentifier;
365
+ return (
366
+ <SortableItem
367
+ id={id}
368
+ key={id}
369
+ style={getItemStyle!(index, id === activeId)}
370
+ itemRenderer={(nodeRef, actionNodeRef) =>
371
+ itemRenderer(item, index, nodeRef, actionNodeRef)
372
+ }
373
+ />
374
+ );
375
+ })}
376
+ </SortableContext>
377
+ </DndContext>
384
378
  );
379
+
380
+ if (onFormChange) {
381
+ return (
382
+ <div
383
+ style={{ width: "100%" }}
384
+ ref={(div) => {
385
+ if (div) setupDiv(div);
386
+ }}
387
+ >
388
+ {children}
389
+ </div>
390
+ );
391
+ }
392
+
393
+ return children;
385
394
  }