argous 1.2.232 → 1.2.233
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.
|
@@ -130,7 +130,7 @@ var ArgousComplexTableBody = react_1.memo(function (_a) {
|
|
|
130
130
|
react_1.default.createElement(core_1.CircularProgress, { disableShrink: true })))) : dadosMostrados.length ? dadosMostrados.map(function (linha, i) {
|
|
131
131
|
var isItemSelected = isSelected(linha[indexToSelect]);
|
|
132
132
|
var isItemOpen = i === open;
|
|
133
|
-
var
|
|
133
|
+
var ghostRow = (lodash_1.isArray(linha)) ? !linha.some(function (value) { return !!value; }) : false;
|
|
134
134
|
var _a = rowProps({ index: i, linhaOriginal: linha, linhaFormatada: line(linha), itensSelecionados: selected }) || {}, title = _a.title, rowProperties = __rest(_a, ["title"]);
|
|
135
135
|
return react_1.default.createElement(dist_1.Draggable, { key: customKey ? lista[i][customKey] : i, render: function (draggableRef) {
|
|
136
136
|
var _a;
|
|
@@ -142,8 +142,8 @@ var ArgousComplexTableBody = react_1.memo(function (_a) {
|
|
|
142
142
|
react_1.default.createElement(core_1.TableRow, __assign({ component: dist_1.Draggable }, rowProperties, { className: clsx_1.default((_a = {},
|
|
143
143
|
_a[classes.hover] = isItemSelected,
|
|
144
144
|
_a[classes.open] = (isItemOpen && !!children),
|
|
145
|
-
_a[classes.ghost] =
|
|
146
|
-
_a), lineClass(line(linha), linha, i), rowProperties.className), hover: true, role: 'checkbox', tabIndex: -1, selected: isItemSelected, style: lineStyle ? lineStyle(linha, line(linha), i) : undefined, onClick: (
|
|
145
|
+
_a[classes.ghost] = ghostRow,
|
|
146
|
+
_a), lineClass(line(linha), linha, i), rowProperties.className), hover: true, role: 'checkbox', tabIndex: -1, selected: isItemSelected, style: lineStyle ? lineStyle(linha, line(linha), i) : undefined, onClick: (ghostRow) ? undefined : (onClick) ? function (e) { return onClick(e, linha, line(linha), i); } : (children) ? function () { return handleOpenClose(i); } : undefined, onDoubleClick: (ghostRow) ? undefined : (onDoubleClick) ? function (e) { return onDoubleClick(e, linha, line(linha), i); } : undefined, innerRef: draggableRef }),
|
|
147
147
|
enableDrag && react_1.default.createElement(core_1.TableCell, { padding: 'checkbox' },
|
|
148
148
|
react_1.default.createElement(core_1.Tooltip, { title: 'Arrastar' },
|
|
149
149
|
react_1.default.createElement(core_1.IconButton, { size: 'small', className: classes.dragHandle },
|
|
@@ -153,7 +153,7 @@ var ArgousComplexTableBody = react_1.memo(function (_a) {
|
|
|
153
153
|
e.stopPropagation();
|
|
154
154
|
handleClick(linha[indexToSelect]);
|
|
155
155
|
}, checked: isItemSelected })),
|
|
156
|
-
lodash_1.isArray(line(linha)) && line(linha).map(function (coluna, j) { return ((
|
|
156
|
+
lodash_1.isArray(line(linha)) && line(linha).map(function (coluna, j) { return ((ghostRow) ? (react_1.default.createElement(core_1.TableCell, __assign({ key: j }, columnProps(j, coluna, linha, line(linha)), { style: columnStyles ? columnStyles[j] : undefined, className: clsx_1.default(classes.tableCell, classes.ghost) }), "\u00A0")) : (react_1.default.createElement(core_1.TableCell, __assign({ key: j }, columnProps(j, coluna, linha, line(linha)), { style: columnStyles ? columnStyles[j] : undefined, className: classes.tableCell }), getCellContent(coluna, dadosMostrados[i], j, i)))); }))),
|
|
157
157
|
children && (react_1.default.createElement(core_1.TableRow, { className: classes.group },
|
|
158
158
|
react_1.default.createElement(core_1.TableCell, { colSpan: (dadosMostrados === null || dadosMostrados === void 0 ? void 0 : dadosMostrados.length) && ((_b = line(dadosMostrados[0])) === null || _b === void 0 ? void 0 : _b.length) + (enableCheck ? 1 : 0) + (enableDrag ? 1 : 0), style: { padding: open === i ? 8 : 0 }, className: 'argous-complex-table-group-cell' },
|
|
159
159
|
react_1.default.createElement(core_1.Collapse, { in: open === i, mountOnEnter: true, unmountOnExit: true }, typeof children === 'function' ? children({ linha: line(linha), linhaOriginal: linha, index: i }) : children))))));
|
|
@@ -111,7 +111,7 @@ const ArgousComplexTableBody = memo(({
|
|
|
111
111
|
|
|
112
112
|
const isItemSelected = isSelected(linha[indexToSelect]);
|
|
113
113
|
const isItemOpen = i === open;
|
|
114
|
-
const
|
|
114
|
+
const ghostRow = (isArray(linha)) ? !linha.some((value) => !!value) : false;
|
|
115
115
|
const { title, ...rowProperties } = rowProps({ index: i, linhaOriginal: linha, linhaFormatada: line(linha), itensSelecionados: selected }) || {};
|
|
116
116
|
|
|
117
117
|
|
|
@@ -127,7 +127,7 @@ const ArgousComplexTableBody = memo(({
|
|
|
127
127
|
{
|
|
128
128
|
[classes.hover]: isItemSelected,
|
|
129
129
|
[classes.open]: (isItemOpen && !!children),
|
|
130
|
-
[classes.ghost]:
|
|
130
|
+
[classes.ghost]: ghostRow
|
|
131
131
|
},
|
|
132
132
|
lineClass(line(linha), linha, i),
|
|
133
133
|
rowProperties.className
|
|
@@ -138,8 +138,8 @@ const ArgousComplexTableBody = memo(({
|
|
|
138
138
|
tabIndex={-1}
|
|
139
139
|
selected={isItemSelected}
|
|
140
140
|
style={lineStyle ? lineStyle(linha, line(linha), i) : undefined}
|
|
141
|
-
onClick={(
|
|
142
|
-
onDoubleClick={(
|
|
141
|
+
onClick={(ghostRow) ? undefined : (onClick) ? e => onClick(e, linha, line(linha), i) : (children) ? () => handleOpenClose(i) : undefined}
|
|
142
|
+
onDoubleClick={(ghostRow) ? undefined : (onDoubleClick) ? e => onDoubleClick(e, linha, line(linha), i) : undefined}
|
|
143
143
|
innerRef={draggableRef}
|
|
144
144
|
>
|
|
145
145
|
{enableDrag && <TableCell padding='checkbox'>
|
|
@@ -156,7 +156,7 @@ const ArgousComplexTableBody = memo(({
|
|
|
156
156
|
}} checked={isItemSelected} />
|
|
157
157
|
</TableCell>}
|
|
158
158
|
{isArray(line(linha)) && line(linha).map((coluna, j) => (
|
|
159
|
-
(
|
|
159
|
+
(ghostRow) ? (
|
|
160
160
|
<TableCell
|
|
161
161
|
key={j}
|
|
162
162
|
{...columnProps(j, coluna, linha, line(linha))}
|