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.
@@ -52,8 +52,10 @@
52
52
  height: fit-content;
53
53
  margin-left: auto;
54
54
  margin-right: auto;
55
+ padding: 2.5rem;
55
56
  }
56
57
  .ar-layout > main > section.full-width {
58
+ width: 100%;
57
59
  }
58
60
 
59
61
  /* Media Queries */
@@ -28,7 +28,7 @@
28
28
  padding: 0 2.5rem;
29
29
  }
30
30
 
31
- .ar-layout > main > section {
31
+ .ar-layout > main > section:not(.full-width) {
32
32
  max-width: none;
33
33
  padding: 2.5rem;
34
34
  }
@@ -29,7 +29,7 @@
29
29
  padding: 0 2.5rem;
30
30
  }
31
31
 
32
- .ar-layout > main > section {
32
+ .ar-layout > main > section:not(.full-width) {
33
33
  max-width: none;
34
34
  padding: 2.5rem;
35
35
  }
@@ -29,7 +29,7 @@
29
29
  padding: 0 2.5rem;
30
30
  }
31
31
 
32
- .ar-layout > main > section {
32
+ .ar-layout > main > section:not(.full-width) {
33
33
  max-width: none;
34
34
  padding: 2.5rem;
35
35
  }
@@ -22,7 +22,7 @@
22
22
  padding: 0 2.5rem;
23
23
  }
24
24
 
25
- .ar-layout > main > section {
25
+ .ar-layout > main > section:not(.full-width) {
26
26
  max-width: 960px;
27
27
  padding: 2.5rem;
28
28
  }
@@ -22,7 +22,7 @@
22
22
  padding: 0 2.5rem;
23
23
  }
24
24
 
25
- .ar-layout > main > section {
25
+ .ar-layout > main > section:not(.full-width) {
26
26
  max-width: 1140px;
27
27
  padding: 2.5rem;
28
28
  }
@@ -23,7 +23,7 @@
23
23
  padding: 0 2.5rem;
24
24
  }
25
25
 
26
- .ar-layout > main > section {
26
+ .ar-layout > main > section:not(.full-width) {
27
27
  max-width: 1340px;
28
28
  padding: 2.5rem;
29
29
  }
@@ -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
- _subrowButton && isHasSubitems ? (React.createElement("td", null, item[_subrowSelector] && (React.createElement("div", { className: "subitem-open-button-wrapper" },
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
- _subrowSelector in subitem && _subrowButton ? (React.createElement("td", null,
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.53",
3
+ "version": "0.2.55",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",