mig-schema-table 3.0.119 → 3.0.121
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/SchemaTable/Th/index.js +3 -3
- package/dist/index.css +1 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -84,7 +84,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
84
84
|
e.dataTransfer.dropEffect = "move";
|
|
85
85
|
e.dataTransfer.setData("text/plain", propName);
|
|
86
86
|
}, [onColumnPositionChange, propName]);
|
|
87
|
-
const onDragEnd = React.useCallback((
|
|
87
|
+
const onDragEnd = React.useCallback(() => {
|
|
88
88
|
if (!onColumnPositionChange) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
@@ -108,7 +108,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
const sourcePropName = e.dataTransfer.getData("text/plain");
|
|
111
|
-
if (!sourcePropName) {
|
|
111
|
+
if (!sourcePropName || sourcePropName === propName) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
onColumnPositionChange(sourcePropName, propName);
|
|
@@ -136,6 +136,6 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
136
136
|
classNames.push(`text-${propConfig.align}`);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" "), title: title }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick
|
|
139
|
+
return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" "), title: title, draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick }, { children: [_jsx("span", Object.assign({ className: "schema-table__th__label-body-text" }, { children: labelBody })), sortAsc === undefined ? null : (_jsx("span", Object.assign({ className: "schema-table__th__sort-icon" }, { children: sortAsc ? "↓" : "↑" })))] })), isSortable || columnFilterStatus !== EColumnFilterStatus.UNAVAILABLE ? (_jsx("button", Object.assign({ className: "schema-table__th__trigger-el", onClick: onTriggerClick }, { children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#404040", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })) }))) : null] })));
|
|
140
140
|
};
|
|
141
141
|
export default React.memo(Th);
|
package/dist/index.css
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { TColumnFilterValue } from "./SchemaTable";
|
|
3
3
|
import { IFilterMenuComponentProps } from "./SchemaTable/ThMenu/FilterMenuComponent";
|
|
4
4
|
export interface IColumnConfig<T> {
|
|
5
|
-
FilterMenu?:
|
|
5
|
+
FilterMenu?: React.ComponentType<IFilterMenuComponentProps>;
|
|
6
6
|
align?: "start" | "center" | "end";
|
|
7
7
|
dateFormat?: string;
|
|
8
8
|
defaultSortDesc?: boolean;
|