aio-table 12.0.0 → 12.0.1
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/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -544,12 +544,12 @@ const useTable = (getProps, getPaging, getColumnOption) => {
|
|
|
544
544
|
return UT.AddToAttrs(attrs, { className, style, attrs: { title: typeof title === 'string' ? title : undefined } });
|
|
545
545
|
};
|
|
546
546
|
const getRowAttrs = (rowDetail, isOdd) => {
|
|
547
|
-
const { rowOption = {}, onSwap,
|
|
547
|
+
const { rowOption = {}, onSwap, gap = [0, 1] } = getProps();
|
|
548
548
|
const { attrs: rowAttrs } = rowOption;
|
|
549
549
|
const attrs = rowAttrs ? rowAttrs(rowDetail) : {};
|
|
550
550
|
let obj = UT.AddToAttrs(attrs, { className: ['aio-table-row', isOdd ? 'aio-table-row-odd' : 'aio-table-row-even'], style: { gap: gap[0] } });
|
|
551
551
|
if (onSwap) {
|
|
552
|
-
obj = Object.assign(Object.assign(Object.assign({}, obj), DragRows.getDragAttrs(
|
|
552
|
+
obj = Object.assign(Object.assign(Object.assign({}, obj), DragRows.getDragAttrs(rowDetail.rowIndex)), DragRows.getDropAttrs(rowDetail.rowIndex));
|
|
553
553
|
}
|
|
554
554
|
return obj;
|
|
555
555
|
};
|