swoop-common 2.2.101 → 2.2.102

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,6 +19,14 @@ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, rea
19
19
  const syncArrayColumnLabels = () => {
20
20
  const tables = root.querySelectorAll(".MuiTable-root");
21
21
  tables.forEach((table) => {
22
+ table.removeAttribute("data-jsonforms-two-col-array");
23
+ const existingLabels = table.querySelectorAll(":scope > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root[data-column-label]");
24
+ existingLabels.forEach((cell) => cell.removeAttribute("data-column-label"));
25
+ });
26
+ tables.forEach((table) => {
27
+ const hasToolbar = Boolean(table.querySelector(":scope > .MuiTableHead-root > .MuiToolbar-root"));
28
+ if (!hasToolbar)
29
+ return;
22
30
  const headerCells = table.querySelectorAll(":scope > .MuiTableHead-root > .MuiTableRow-root:last-child > .MuiTableCell-root");
23
31
  if (headerCells.length === 0)
24
32
  return;
@@ -27,6 +35,7 @@ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, rea
27
35
  .filter((label) => label.length > 0);
28
36
  if (labels.length === 0)
29
37
  return;
38
+ table.setAttribute("data-jsonforms-two-col-array", "true");
30
39
  const bodyRows = table.querySelectorAll(":scope > .MuiTableBody-root > .MuiTableRow-root");
31
40
  bodyRows.forEach((row) => {
32
41
  const bodyCells = row.querySelectorAll(":scope > .MuiTableCell-root");
@@ -48,7 +57,7 @@ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, rea
48
57
  }, [json, ui]);
49
58
  return (React.createElement(ComponentContext, { componentId: hintComponentId, stage: stage },
50
59
  React.createElement(GlobalStyles, { styles: {
51
- ".json-forms-wrapper .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root": {
60
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableBody-root > .MuiTableRow-root": {
52
61
  display: "grid",
53
62
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
54
63
  columnGap: "24px",
@@ -57,21 +66,21 @@ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, rea
57
66
  position: "relative",
58
67
  paddingRight: "52px",
59
68
  },
60
- ".json-forms-wrapper .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root": {
69
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root": {
61
70
  minWidth: 0,
62
71
  width: "100%",
63
72
  padding: 0,
64
73
  },
65
- ".json-forms-wrapper .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root[data-column-label]::before": {
74
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root[data-column-label]::before": {
66
75
  content: "attr(data-column-label)",
67
76
  display: "block",
68
77
  marginBottom: "8px",
69
78
  fontWeight: 600,
70
79
  },
71
- ".json-forms-wrapper .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root:only-child": {
80
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root:only-child": {
72
81
  gridColumn: "1 / -1",
73
82
  },
74
- ".json-forms-wrapper .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root:last-child": {
83
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root:last-child": {
75
84
  position: "absolute",
76
85
  right: 0,
77
86
  top: "50%",
@@ -79,7 +88,7 @@ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, rea
79
88
  width: "auto",
80
89
  padding: 0,
81
90
  },
82
- ".json-forms-wrapper .MuiTable-root > .MuiTableHead-root > .MuiTableRow-root:last-child": {
91
+ ".json-forms-wrapper .MuiTable-root[data-jsonforms-two-col-array='true'] > .MuiTableHead-root > .MuiTableRow-root:last-child": {
83
92
  display: "none",
84
93
  },
85
94
  } }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.2.101",
3
+ "version": "2.2.102",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {