ar-design 0.2.52 → 0.2.54
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.
|
@@ -229,13 +229,13 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
229
229
|
else
|
|
230
230
|
setSelectionItems((prev) => prev.filter((_item) => _item !== item));
|
|
231
231
|
} }))),
|
|
232
|
-
|
|
232
|
+
isHasSubitems && _subrowButton ? (React.createElement("td", null, item[_subrowSelector] && (React.createElement("div", { className: "subitem-open-button-wrapper" },
|
|
233
233
|
React.createElement("span", { className: `subitem-open-button ${(showSubitems[index] && "opened") ?? ""}`, onClick: () => {
|
|
234
234
|
setShowSubitems((prev) => ({
|
|
235
235
|
...prev,
|
|
236
236
|
[`${index}`]: !prev[`${index}`],
|
|
237
237
|
}));
|
|
238
|
-
} }))))) : _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
238
|
+
} }))))) : isHasSubitems && _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
239
239
|
columns.map((c, cIndex) => renderCell(item, c, cIndex, index, 0))),
|
|
240
240
|
showSubitems[index] && item[_subrowSelector] && (React.createElement(SubitemList, { items: item[_subrowSelector], columns: columns, index: index, depth: 1.5 }))));
|
|
241
241
|
};
|
|
@@ -269,10 +269,11 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
269
269
|
const SubitemList = ({ items, columns, index, depth }) => {
|
|
270
270
|
return items.map((subitem, subindex) => {
|
|
271
271
|
const _subitem = subitem[_subrowSelector];
|
|
272
|
+
const isHasSubitems = _subrowSelector in subitem;
|
|
272
273
|
// TODO: Keylere bakılacak...
|
|
273
274
|
return (React.createElement(Fragment, { key: `subitem-${index}-${subindex}-${Math.random()}` },
|
|
274
275
|
React.createElement("tr", { key: `subitem-${index}-${subindex}-${Math.random()}`, className: `subrow-item ${_subrowButton ? "type-b" : "type-a"}` },
|
|
275
|
-
|
|
276
|
+
isHasSubitems && _subrowButton ? (React.createElement("td", null,
|
|
276
277
|
React.createElement("div", { className: "subitem-open-button-wrapper" },
|
|
277
278
|
React.createElement("span", { className: `${(showSubitems[`${index}.${subindex}`] && "opened") ?? ""} ${!_subitem && "passive"}`, onClick: () => {
|
|
278
279
|
if (!_subitem)
|
|
@@ -281,7 +282,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
281
282
|
...prev,
|
|
282
283
|
[`${index}.${subindex}`]: !prev[`${index}.${subindex}`],
|
|
283
284
|
}));
|
|
284
|
-
} })))) : _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
285
|
+
} })))) : isHasSubitems && _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
285
286
|
columns.map((c, cIndex) => renderCell(subitem, c, cIndex, subindex, depth * 1.5))),
|
|
286
287
|
showSubitems[`${index}.${subindex}`] && _subitem && (React.createElement(SubitemList, { key: `subitem-${index}-${subindex}-${Math.random()}`, items: _subitem, columns: columns, index: subindex, depth: depth * 1.5 }))));
|
|
287
288
|
});
|
|
@@ -358,7 +359,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
358
359
|
React.createElement("table", { ref: ref },
|
|
359
360
|
React.createElement("thead", null,
|
|
360
361
|
React.createElement("tr", { key: "selection" },
|
|
361
|
-
_subrowButton && React.createElement("td", { style: { width: 0, minWidth: 0 } }),
|
|
362
|
+
data.some((item) => _subrowSelector in item) && _subrowButton && (React.createElement("td", { style: { width: 0, minWidth: 0 } })),
|
|
362
363
|
selections && (React.createElement("th", { className: "selection-col sticky-left", "data-sticky-position": "left" },
|
|
363
364
|
React.createElement(Checkbox, { variant: "filled", status: "primary", checked: selectAll, onChange: (event) => {
|
|
364
365
|
if (_checkboxItems.current.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ar-design",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.54",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"description": "AR Design is a (react | nextjs) ui library.",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"react": "
|
|
49
|
-
"react-dom": "
|
|
48
|
+
"react": ">=18.0.0",
|
|
49
|
+
"react-dom": ">=18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.2.0",
|