zmdms-webui 2.7.7 → 2.7.8
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/es/container/index.css +1 -1
- package/dist/es/dynamicsetting/dynamicDrawer.js +13 -11
- package/dist/es/dynamicsetting/index.css +1 -1
- package/dist/es/dynamicsetting/useSearch.js +93 -0
- package/dist/es/form/common-search-list.js +1 -1
- package/dist/es/sortable/sortable-item.d.ts +3 -0
- package/dist/es/sortable/sortable-item.js +43 -20
- package/dist/es/table/index.css +1 -1
- package/dist/es/table/table.js +1 -1
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/less/components/Container/style/index.less +1 -1
- package/dist/less/components/DynamicSetting/style/index.less +45 -0
- package/dist/less/components/Table/style/index.less +1 -0
- package/package.json +1 -1
- package/dist/es/dynamicsetting/sortable.js +0 -68
|
@@ -70,6 +70,51 @@
|
|
|
70
70
|
}
|
|
71
71
|
.ant-drawer-body {
|
|
72
72
|
padding: 0;
|
|
73
|
+
.search-drawer--filter {
|
|
74
|
+
height: 100%;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
.search-drawer--filter-input {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
.ant-input-group-wrapper.ant-input-search {
|
|
81
|
+
width: 100%;
|
|
82
|
+
.ant-input-wrapper {
|
|
83
|
+
input {
|
|
84
|
+
background: #f0f0f0;
|
|
85
|
+
border: 0px;
|
|
86
|
+
color: #333333;
|
|
87
|
+
border-radius: 0 0 0 0;
|
|
88
|
+
text-align: center;
|
|
89
|
+
&:focus {
|
|
90
|
+
outline: 0;
|
|
91
|
+
box-shadow: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
.ant-input-group-addon {
|
|
95
|
+
> button {
|
|
96
|
+
background: #f0f0f0;
|
|
97
|
+
border: 0px;
|
|
98
|
+
height: 28px;
|
|
99
|
+
border-radius: 0 0 0 0;
|
|
100
|
+
outline: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
> .selector-all {
|
|
106
|
+
border-radius: 0;
|
|
107
|
+
border-right: 0;
|
|
108
|
+
}
|
|
109
|
+
> .selector-inverse {
|
|
110
|
+
border-radius: 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.ant-checkbox-group {
|
|
114
|
+
flex: 1;
|
|
115
|
+
overflow: auto;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
73
118
|
.ant-checkbox-group {
|
|
74
119
|
width: 100%;
|
|
75
120
|
}
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import classNames from '../node_modules/classnames/index.js';
|
|
5
|
-
import { useDrop } from '../node_modules/react-dnd/dist/hooks/useDrop/useDrop.js';
|
|
6
|
-
import { useDrag } from '../node_modules/react-dnd/dist/hooks/useDrag/useDrag.js';
|
|
7
|
-
|
|
8
|
-
var Sortable = function (_a) {
|
|
9
|
-
var type = _a.type, onMoveItem = _a.onMoveItem, index = _a.index, id = _a.id, children = _a.children, style = _a.style, className = _a.className;
|
|
10
|
-
var ref = useRef(null);
|
|
11
|
-
var classes = classNames("zt-sortable-new", className, {});
|
|
12
|
-
/**
|
|
13
|
-
* @description 定义可放置对象
|
|
14
|
-
*/
|
|
15
|
-
var _b = useDrop({
|
|
16
|
-
accept: type,
|
|
17
|
-
hover: function (item, monitor) {
|
|
18
|
-
var _a;
|
|
19
|
-
if (!ref.current) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
// 当前拖动项索引
|
|
23
|
-
var dragIndex = item.index;
|
|
24
|
-
// 当前放置位置索引
|
|
25
|
-
var hoverIndex = index;
|
|
26
|
-
// 不要将项目本身替换
|
|
27
|
-
if (dragIndex === hoverIndex) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// 获取当前项的位置信息
|
|
31
|
-
var hoverBoundingRect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
32
|
-
// 元素高度的一半
|
|
33
|
-
var hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
34
|
-
// 确定鼠标位置
|
|
35
|
-
var clientOffset = monitor.getClientOffset();
|
|
36
|
-
// 鼠标位置纵坐标 与 当前hover元素顶部位置差
|
|
37
|
-
var hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
38
|
-
// 临界值判断
|
|
39
|
-
// 如果当前拖拽元素本身在当前放置元素之上 并且 鼠标位置与当前放置元素之差 要小于中间位置
|
|
40
|
-
if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// 如果当前拖拽元素本身在当前放置元素之下 并且鼠标位置与当前放置元素之差要 大于 中间位置
|
|
44
|
-
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
onMoveItem(dragIndex, hoverIndex);
|
|
48
|
-
item.index = hoverIndex;
|
|
49
|
-
},
|
|
50
|
-
}), drop = _b[1];
|
|
51
|
-
/**
|
|
52
|
-
* @description 定义可拖动对象
|
|
53
|
-
*/
|
|
54
|
-
var _c = useDrag({
|
|
55
|
-
type: type,
|
|
56
|
-
item: function () {
|
|
57
|
-
return { id: id, index: index };
|
|
58
|
-
},
|
|
59
|
-
collect: function (monitor) { return ({
|
|
60
|
-
isDragging: monitor.isDragging(),
|
|
61
|
-
}); },
|
|
62
|
-
}), isDragging = _c[0].isDragging, drag = _c[1];
|
|
63
|
-
var opacity = isDragging ? 0 : 1;
|
|
64
|
-
drag(drop(ref));
|
|
65
|
-
return (jsx("div", __assign({ ref: ref, className: classes, style: __assign(__assign({}, style), { opacity: opacity }) }, { children: children })));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { Sortable as default };
|