ar-design 0.2.53 → 0.2.55
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/dist/assets/css/components/layout/layout.css +2 -0
- package/dist/assets/css/components/layout/media-queries/large.css +1 -1
- package/dist/assets/css/components/layout/media-queries/medium.css +1 -1
- package/dist/assets/css/components/layout/media-queries/small.css +1 -1
- package/dist/assets/css/components/layout/media-queries/x-large.css +1 -1
- package/dist/assets/css/components/layout/media-queries/xx-large.css +1 -1
- package/dist/assets/css/components/layout/media-queries/xxx-large.css +1 -1
- package/dist/components/data-display/table/index.js +6 -6
- package/package.json +1 -1
|
@@ -28,7 +28,6 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
28
28
|
const [selectAll, setSelectAll] = useState(false);
|
|
29
29
|
const [selectionItems, setSelectionItems] = useState([]);
|
|
30
30
|
const [showSubitems, setShowSubitems] = useState({});
|
|
31
|
-
const [isTrueSubitems, setIsTrueSubitems] = useState({});
|
|
32
31
|
// states -> File
|
|
33
32
|
const [files, setFiles] = useState([]);
|
|
34
33
|
const [formData, setFormData] = useState(undefined);
|
|
@@ -229,13 +228,13 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
229
228
|
else
|
|
230
229
|
setSelectionItems((prev) => prev.filter((_item) => _item !== item));
|
|
231
230
|
} }))),
|
|
232
|
-
|
|
231
|
+
isHasSubitems && _subrowButton ? (React.createElement("td", null, item[_subrowSelector] && (React.createElement("div", { className: "subitem-open-button-wrapper" },
|
|
233
232
|
React.createElement("span", { className: `subitem-open-button ${(showSubitems[index] && "opened") ?? ""}`, onClick: () => {
|
|
234
233
|
setShowSubitems((prev) => ({
|
|
235
234
|
...prev,
|
|
236
235
|
[`${index}`]: !prev[`${index}`],
|
|
237
236
|
}));
|
|
238
|
-
} }))))) : _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
237
|
+
} }))))) : isHasSubitems && _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
239
238
|
columns.map((c, cIndex) => renderCell(item, c, cIndex, index, 0))),
|
|
240
239
|
showSubitems[index] && item[_subrowSelector] && (React.createElement(SubitemList, { items: item[_subrowSelector], columns: columns, index: index, depth: 1.5 }))));
|
|
241
240
|
};
|
|
@@ -269,10 +268,11 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
269
268
|
const SubitemList = ({ items, columns, index, depth }) => {
|
|
270
269
|
return items.map((subitem, subindex) => {
|
|
271
270
|
const _subitem = subitem[_subrowSelector];
|
|
271
|
+
const isHasSubitems = _subrowSelector in subitem;
|
|
272
272
|
// TODO: Keylere bakılacak...
|
|
273
273
|
return (React.createElement(Fragment, { key: `subitem-${index}-${subindex}-${Math.random()}` },
|
|
274
274
|
React.createElement("tr", { key: `subitem-${index}-${subindex}-${Math.random()}`, className: `subrow-item ${_subrowButton ? "type-b" : "type-a"}` },
|
|
275
|
-
|
|
275
|
+
isHasSubitems && _subrowButton ? (React.createElement("td", null,
|
|
276
276
|
React.createElement("div", { className: "subitem-open-button-wrapper" },
|
|
277
277
|
React.createElement("span", { className: `${(showSubitems[`${index}.${subindex}`] && "opened") ?? ""} ${!_subitem && "passive"}`, onClick: () => {
|
|
278
278
|
if (!_subitem)
|
|
@@ -281,7 +281,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
281
281
|
...prev,
|
|
282
282
|
[`${index}.${subindex}`]: !prev[`${index}.${subindex}`],
|
|
283
283
|
}));
|
|
284
|
-
} })))) : _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
284
|
+
} })))) : isHasSubitems && _subrowButton ? (React.createElement("td", { style: { width: 0, minWidth: 0 } })) : null,
|
|
285
285
|
columns.map((c, cIndex) => renderCell(subitem, c, cIndex, subindex, depth * 1.5))),
|
|
286
286
|
showSubitems[`${index}.${subindex}`] && _subitem && (React.createElement(SubitemList, { key: `subitem-${index}-${subindex}-${Math.random()}`, items: _subitem, columns: columns, index: subindex, depth: depth * 1.5 }))));
|
|
287
287
|
});
|
|
@@ -358,7 +358,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
358
358
|
React.createElement("table", { ref: ref },
|
|
359
359
|
React.createElement("thead", null,
|
|
360
360
|
React.createElement("tr", { key: "selection" },
|
|
361
|
-
_subrowButton && React.createElement("td", { style: { width: 0, minWidth: 0 } }),
|
|
361
|
+
data.some((item) => _subrowSelector in item) && _subrowButton && (React.createElement("td", { style: { width: 0, minWidth: 0 } })),
|
|
362
362
|
selections && (React.createElement("th", { className: "selection-col sticky-left", "data-sticky-position": "left" },
|
|
363
363
|
React.createElement(Checkbox, { variant: "filled", status: "primary", checked: selectAll, onChange: (event) => {
|
|
364
364
|
if (_checkboxItems.current.length > 0) {
|