@gct-paas/render 0.1.5-dev.1 → 0.1.5-dev.10
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/index.min.css +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/es/Event/Dependency/controller.mjs +2 -2
- package/es/Event/Dependency/displayRule.mjs +2 -2
- package/es/Event/Dependency/useDependency.mjs +2 -2
- package/es/Event/baseEvent.d.ts +4 -4
- package/es/Event/baseEvent.mjs +5 -5
- package/es/Event/bizServiceRequest.d.ts +4 -4
- package/es/Event/bizServiceRequest.mjs +19 -10
- package/es/Event/utils/runGlobalByPage.d.ts +4 -4
- package/es/Event/utils/runGlobalByPage.mjs +1 -1
- package/es/controller/design-render/design-render.controller.d.ts +1 -1
- package/es/hooks/useStorageRef.mjs +1 -1
- package/es/hooks/widgets/useFileAttrsHooks.d.ts +6 -6
- package/es/hooks/widgets/useFileAttrsHooks.mjs +1 -1
- package/es/index.d.ts +4 -3
- package/es/index.mjs +12 -15
- package/es/locale/sys/process.d.ts +8 -0
- package/es/locale/sys.d.ts +4 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable/vue3-dnd-draggable.css +73 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable/vue3-dnd-draggable.d.ts +70 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable/vue3-dnd-draggable.mjs +119 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable-item/vue3-dnd-draggable-item.css +74 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable-item/vue3-dnd-draggable-item.d.ts +69 -0
- package/es/modules/vue3-dnd/components/vue3-dnd-draggable-item/vue3-dnd-draggable-item.mjs +165 -0
- package/es/modules/vue3-dnd/index.d.ts +3 -0
- package/es/modules/vue3-dnd/index.mjs +2 -0
- package/es/modules/vue3-dnd/interface/i-vue3-dnd-draggable-options.d.ts +294 -0
- package/es/modules/vue3-dnd/interface/index.d.ts +1 -0
- package/es/utils/expression/index.mjs +1 -1
- package/es/utils/expression/regularExpression/methods.mjs +1 -1
- package/es/utils/field-empty-value.d.ts +6 -0
- package/es/utils/field-empty-value.mjs +17 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.mjs +2 -0
- package/es/utils/is.d.ts +21 -0
- package/es/utils/is.mjs +70 -0
- package/es/utils/model-transformer.d.ts +1 -1
- package/es/utils/search/listhook.d.ts +6 -0
- package/es/utils/search/listhook.mjs +18 -1
- package/package.json +26 -26
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import './vue3-dnd-draggable-item.css';/* empty css */
|
|
2
|
+
import { useNamespace } from "@gct-paas/core";
|
|
3
|
+
import { createVNode, defineComponent, nextTick, onMounted, ref } from "vue";
|
|
4
|
+
import { useDrag, useDrop } from "vue3-dnd";
|
|
5
|
+
//#region src/modules/vue3-dnd/components/vue3-dnd-draggable-item/vue3-dnd-draggable-item.tsx
|
|
6
|
+
var Vue3DndDraggableItem = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "Vue3DndDraggableItem",
|
|
8
|
+
props: {
|
|
9
|
+
group: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
index: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
item: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
config: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
add: {
|
|
26
|
+
type: Function,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
remove: {
|
|
30
|
+
type: Function,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
move: {
|
|
34
|
+
type: Function,
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(props) {
|
|
39
|
+
const ns = useNamespace("vue3-dnd-draggable-item");
|
|
40
|
+
const elRef = ref(null);
|
|
41
|
+
const isBeforeHover = ref(false);
|
|
42
|
+
const { config } = props;
|
|
43
|
+
const [dragCollect, drag, preview] = useDrag({
|
|
44
|
+
type: config.type,
|
|
45
|
+
item: () => {
|
|
46
|
+
return {
|
|
47
|
+
group: props.group,
|
|
48
|
+
item: props.item
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
collect: (monitor) => {
|
|
52
|
+
return {
|
|
53
|
+
canDrag: monitor.canDrag(),
|
|
54
|
+
isDragging: monitor.isDragging()
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
canDrag(monitor) {
|
|
58
|
+
if (config.canDrag) return config.canDrag(monitor);
|
|
59
|
+
return true;
|
|
60
|
+
},
|
|
61
|
+
end(item, monitor) {
|
|
62
|
+
if (config.end) return config.end(item, monitor);
|
|
63
|
+
const result = monitor.getDropResult();
|
|
64
|
+
if (result && result.group !== props.group) props.remove(item);
|
|
65
|
+
},
|
|
66
|
+
options: config.dragOptions,
|
|
67
|
+
previewOptions: config.previewOptions
|
|
68
|
+
});
|
|
69
|
+
const [dropCollect, drop] = useDrop({
|
|
70
|
+
accept: config.type,
|
|
71
|
+
collect(monitor) {
|
|
72
|
+
return {
|
|
73
|
+
handlerId: monitor.getHandlerId(),
|
|
74
|
+
canDrop: monitor.canDrop(),
|
|
75
|
+
isShallowOver: monitor.isOver({ shallow: true }),
|
|
76
|
+
isOver: monitor.isOver()
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
hover(item, monitor) {
|
|
80
|
+
if (config.hover) return config.hover(item, monitor);
|
|
81
|
+
if (monitor.canDrop() === false || dragCollect.value.isDragging === true) return;
|
|
82
|
+
if (props.item === item.item) return;
|
|
83
|
+
if (monitor.isOver({ shallow: true })) {
|
|
84
|
+
const rect = elRef.value.getBoundingClientRect();
|
|
85
|
+
const offset = monitor.getClientOffset();
|
|
86
|
+
const dropOffset = config.offset ?? 0;
|
|
87
|
+
let difference = 0;
|
|
88
|
+
if (config.direction === "vertical") {
|
|
89
|
+
const { top, height } = rect;
|
|
90
|
+
const { y } = offset;
|
|
91
|
+
const half = height / 2;
|
|
92
|
+
difference = y - top - half;
|
|
93
|
+
if (Math.abs(difference) < dropOffset) return;
|
|
94
|
+
if (difference < 0) isBeforeHover.value = true;
|
|
95
|
+
else isBeforeHover.value = false;
|
|
96
|
+
} else if (config.direction === "horizontal") {
|
|
97
|
+
const { left, width } = rect;
|
|
98
|
+
const { x } = offset;
|
|
99
|
+
const half = width / 2;
|
|
100
|
+
difference = x - left - half;
|
|
101
|
+
if (Math.abs(difference) < dropOffset) return;
|
|
102
|
+
if (difference < 0) isBeforeHover.value = true;
|
|
103
|
+
else isBeforeHover.value = false;
|
|
104
|
+
}
|
|
105
|
+
const key = config.key ?? "id";
|
|
106
|
+
if (item.group === props.group) props.move(isBeforeHover.value, props.item[key], item.item[key]);
|
|
107
|
+
else props.add(isBeforeHover.value, props.item[key], item.item);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
canDrop(item, monitor) {
|
|
111
|
+
if (config.canDrop) return config.canDrop(item, monitor);
|
|
112
|
+
if (dragCollect.value.isDragging === true) return false;
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
drop(item, monitor) {
|
|
116
|
+
if (config.drop) return config.drop(item, monitor);
|
|
117
|
+
return { group: props.group };
|
|
118
|
+
},
|
|
119
|
+
options: config.dropOptions
|
|
120
|
+
});
|
|
121
|
+
if (props.config.isCustomHandle !== true && !props.config.handle) drag(elRef);
|
|
122
|
+
drop(elRef);
|
|
123
|
+
preview(elRef);
|
|
124
|
+
onMounted(() => {
|
|
125
|
+
nextTick(() => {
|
|
126
|
+
if (props.config.handle && elRef.value) {
|
|
127
|
+
const el = elRef.value.querySelector(props.config.handle);
|
|
128
|
+
if (el) drag(el);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
ns,
|
|
134
|
+
elRef,
|
|
135
|
+
dragCollect,
|
|
136
|
+
dropCollect,
|
|
137
|
+
isBeforeHover,
|
|
138
|
+
drag,
|
|
139
|
+
preview
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
render() {
|
|
143
|
+
return createVNode("div", {
|
|
144
|
+
"ref": "elRef",
|
|
145
|
+
"class": [
|
|
146
|
+
this.ns.b(),
|
|
147
|
+
this.ns.is("dragging", this.dragCollect.isDragging),
|
|
148
|
+
this.ns.is("shallow-over", this.dropCollect.isShallowOver)
|
|
149
|
+
]
|
|
150
|
+
}, [this.$slots.default?.({
|
|
151
|
+
item: this.item,
|
|
152
|
+
index: this.index,
|
|
153
|
+
isDragging: this.dragCollect.isDragging,
|
|
154
|
+
isShallowOver: this.dropCollect.isShallowOver,
|
|
155
|
+
isOver: this.dropCollect.isOver,
|
|
156
|
+
isBeforeHover: this.isBeforeHover,
|
|
157
|
+
isAfterHover: !this.isBeforeHover,
|
|
158
|
+
direction: this.config.direction,
|
|
159
|
+
drag: this.drag,
|
|
160
|
+
preview: this.preview
|
|
161
|
+
})]);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
//#endregion
|
|
165
|
+
export { Vue3DndDraggableItem };
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { ConnectDragPreview, ConnectDragSource, DragPreviewOptions, DragSourceMonitor, DragSourceOptions, DropTargetMonitor, DropTargetOptions } from 'vue3-dnd';
|
|
2
|
+
/**
|
|
3
|
+
* 拖拽绘制项参数
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-08-20 16:08:30
|
|
7
|
+
* @export
|
|
8
|
+
* @interface IRenderOptions
|
|
9
|
+
* @template O
|
|
10
|
+
*/
|
|
11
|
+
export interface IRenderOptions<O = unknown> {
|
|
12
|
+
/**
|
|
13
|
+
* 节点数据
|
|
14
|
+
*
|
|
15
|
+
* @author zhanghanrui
|
|
16
|
+
* @date 2024-08-20 16:08:42
|
|
17
|
+
* @type {O}
|
|
18
|
+
*/
|
|
19
|
+
item: O;
|
|
20
|
+
/**
|
|
21
|
+
* 当前排序
|
|
22
|
+
*
|
|
23
|
+
* @author zhanghanrui
|
|
24
|
+
* @date 2024-08-20 16:08:47
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
index: number;
|
|
28
|
+
/**
|
|
29
|
+
* 是否正在拖拽
|
|
30
|
+
*
|
|
31
|
+
* @author zhanghanrui
|
|
32
|
+
* @date 2024-08-20 16:08:53
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
isDragging: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 是否悬浮于当前元素内,并且只有当前元素。多层悬浮时,以最底层触发此参数
|
|
38
|
+
*
|
|
39
|
+
* @author zhanghanrui
|
|
40
|
+
* @date 2024-08-20 16:08:00
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
*/
|
|
43
|
+
isShallowOver: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 是否在此元素上
|
|
46
|
+
*
|
|
47
|
+
* @author zhanghanrui
|
|
48
|
+
* @date 2024-08-20 16:08:57
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
isOver: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 是否悬浮于此元素前半段(需要根据拖拽线方向,判断是上下还是左右)
|
|
54
|
+
*
|
|
55
|
+
* @author zhanghanrui
|
|
56
|
+
* @date 2024-08-20 16:08:07
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
*/
|
|
59
|
+
isBeforeHover: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 是否悬浮于此元素后半段(需要根据拖拽线方向,判断是上下还是左右)
|
|
62
|
+
*
|
|
63
|
+
* @author zhanghanrui
|
|
64
|
+
* @date 2024-08-20 16:08:29
|
|
65
|
+
* @type {boolean}
|
|
66
|
+
*/
|
|
67
|
+
isAfterHover: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 放置线方向
|
|
70
|
+
*
|
|
71
|
+
* @author zhanghanrui
|
|
72
|
+
* @date 2024-08-20 16:08:34
|
|
73
|
+
* @type {('vertical' | 'horizontal')}
|
|
74
|
+
*/
|
|
75
|
+
direction: 'vertical' | 'horizontal';
|
|
76
|
+
/**
|
|
77
|
+
* 自定义拖拽 handle 元素
|
|
78
|
+
*
|
|
79
|
+
* @author zhanghanrui
|
|
80
|
+
* @date 2024-08-20 17:08:35
|
|
81
|
+
* @type {ConnectDragSource<DragSourceOptions>}
|
|
82
|
+
*/
|
|
83
|
+
drag?: ConnectDragSource<DragSourceOptions>;
|
|
84
|
+
/**
|
|
85
|
+
* 自定义拖拽预览
|
|
86
|
+
*
|
|
87
|
+
* @author zhanghanrui
|
|
88
|
+
* @date 2024-09-26 17:09:42
|
|
89
|
+
* @type {ConnectDragPreview<DragPreviewOptions>}
|
|
90
|
+
*/
|
|
91
|
+
preview?: ConnectDragPreview<DragPreviewOptions>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 放置结果回执
|
|
95
|
+
*
|
|
96
|
+
* @author zhanghanrui
|
|
97
|
+
* @date 2024-08-20 16:08:38
|
|
98
|
+
* @export
|
|
99
|
+
* @interface IDropResult
|
|
100
|
+
*/
|
|
101
|
+
export interface IDropResult {
|
|
102
|
+
/**
|
|
103
|
+
* 放置分组标识
|
|
104
|
+
*
|
|
105
|
+
* @author zhanghanrui
|
|
106
|
+
* @date 2024-08-20 16:08:52
|
|
107
|
+
* @type {string}
|
|
108
|
+
*/
|
|
109
|
+
group: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 拖拽数据项
|
|
113
|
+
*
|
|
114
|
+
* @author zhanghanrui
|
|
115
|
+
* @date 2024-08-20 16:08:57
|
|
116
|
+
* @export
|
|
117
|
+
* @interface IDragDataItem
|
|
118
|
+
* @template O
|
|
119
|
+
*/
|
|
120
|
+
export interface IDragDataItem<O = unknown> {
|
|
121
|
+
/**
|
|
122
|
+
* 拖拽分组实例标识
|
|
123
|
+
*
|
|
124
|
+
* @author zhanghanrui
|
|
125
|
+
* @date 2024-08-20 16:08:03
|
|
126
|
+
* @type {string}
|
|
127
|
+
*/
|
|
128
|
+
group: string;
|
|
129
|
+
/**
|
|
130
|
+
* 当前拖拽数据
|
|
131
|
+
*
|
|
132
|
+
* @author zhanghanrui
|
|
133
|
+
* @date 2024-08-20 16:08:22
|
|
134
|
+
* @type {O}
|
|
135
|
+
*/
|
|
136
|
+
item: O;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 拖拽配置
|
|
140
|
+
*
|
|
141
|
+
* @author zhanghanrui
|
|
142
|
+
* @date 2024-08-20 14:08:48
|
|
143
|
+
* @export
|
|
144
|
+
* @interface IVue3DndDraggableOptions
|
|
145
|
+
* @template O
|
|
146
|
+
* @template R
|
|
147
|
+
*/
|
|
148
|
+
export interface IVue3DndDraggableOptions<O = unknown, R extends IDropResult = IDropResult> {
|
|
149
|
+
/**
|
|
150
|
+
* 拖拽分组类型(同类型下,可跨分组拖拽)
|
|
151
|
+
*
|
|
152
|
+
* @author zhanghanrui
|
|
153
|
+
* @date 2024-08-20 14:08:26
|
|
154
|
+
* @type {string}
|
|
155
|
+
*/
|
|
156
|
+
type: string;
|
|
157
|
+
/**
|
|
158
|
+
* 放置线方向
|
|
159
|
+
*
|
|
160
|
+
* @author zhanghanrui
|
|
161
|
+
* @date 2024-08-20 14:08:09
|
|
162
|
+
* @type {('vertical' | 'horizontal')} 垂直方向 | 水平方向
|
|
163
|
+
*/
|
|
164
|
+
direction: 'vertical' | 'horizontal';
|
|
165
|
+
/**
|
|
166
|
+
* 放置线偏移量
|
|
167
|
+
*
|
|
168
|
+
* @author zhanghanrui
|
|
169
|
+
* @date 2024-09-22 10:09:36
|
|
170
|
+
* @type {number}
|
|
171
|
+
*/
|
|
172
|
+
offset?: number;
|
|
173
|
+
/**
|
|
174
|
+
* 自定义拖拽元素选择器
|
|
175
|
+
*
|
|
176
|
+
* @author zhanghanrui
|
|
177
|
+
* @date 2024-08-20 19:08:30
|
|
178
|
+
* @type {string}
|
|
179
|
+
*/
|
|
180
|
+
handle?: string;
|
|
181
|
+
/**
|
|
182
|
+
* 项数据标识
|
|
183
|
+
*
|
|
184
|
+
* @default 'id'
|
|
185
|
+
* @author zhanghanrui
|
|
186
|
+
* @date 2024-09-22 10:09:43
|
|
187
|
+
* @type {string}
|
|
188
|
+
*/
|
|
189
|
+
key?: string;
|
|
190
|
+
/**
|
|
191
|
+
* 是否自定义拖拽节点
|
|
192
|
+
*
|
|
193
|
+
* @default false
|
|
194
|
+
* @author zhanghanrui
|
|
195
|
+
* @date 2024-08-20 17:08:41
|
|
196
|
+
* @type {boolean}
|
|
197
|
+
*/
|
|
198
|
+
isCustomHandle?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* 是否允许拖拽
|
|
201
|
+
*
|
|
202
|
+
* @author zhanghanrui
|
|
203
|
+
* @date 2024-08-20 14:08:35
|
|
204
|
+
* @template O
|
|
205
|
+
* @template R
|
|
206
|
+
* @param {DragSourceMonitor<IDragDataItem<O>, R>} monitor
|
|
207
|
+
* @return {*} {boolean}
|
|
208
|
+
*/
|
|
209
|
+
canDrag?(monitor: DragSourceMonitor<IDragDataItem<O>, R>): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* 是否允许放置
|
|
212
|
+
*
|
|
213
|
+
* @author zhanghanrui
|
|
214
|
+
* @date 2024-08-20 14:08:45
|
|
215
|
+
* @template O
|
|
216
|
+
* @template R
|
|
217
|
+
* @param {O} item
|
|
218
|
+
* @param {DropTargetMonitor<IDragDataItem<O>, R>} monitor
|
|
219
|
+
* @return {*} {boolean}
|
|
220
|
+
*/
|
|
221
|
+
canDrop?(item: IDragDataItem<O>, monitor: DropTargetMonitor<IDragDataItem<O>, R>): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* 是否允许放置容器内
|
|
224
|
+
*
|
|
225
|
+
* @author zhanghanrui
|
|
226
|
+
* @date 2024-08-20 15:08:22
|
|
227
|
+
* @param {O} item
|
|
228
|
+
* @param {DropTargetMonitor<IDragDataItem<O>, R>} monitor
|
|
229
|
+
* @return {*} {boolean}
|
|
230
|
+
*/
|
|
231
|
+
canDropContainer?(item: IDragDataItem<O>, monitor: DropTargetMonitor<IDragDataItem<O>, R>): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* 放置钩子
|
|
234
|
+
*
|
|
235
|
+
* @author zhanghanrui
|
|
236
|
+
* @date 2024-08-20 14:08:36
|
|
237
|
+
* @param {O} item
|
|
238
|
+
* @param {DropTargetMonitor<IDragDataItem<O>, R>} monitor
|
|
239
|
+
* @return {*} {(O | undefined)}
|
|
240
|
+
*/
|
|
241
|
+
drop?(item: IDragDataItem<O>, monitor: DropTargetMonitor<IDragDataItem<O>, R>): R | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* 放置容器钩子
|
|
244
|
+
*
|
|
245
|
+
* @author zhanghanrui
|
|
246
|
+
* @date 2024-08-20 15:08:26
|
|
247
|
+
* @param {O} item
|
|
248
|
+
* @param {DropTargetMonitor<IDragDataItem<O>, R>} monitor
|
|
249
|
+
* @return {*} {(O | undefined)}
|
|
250
|
+
*/
|
|
251
|
+
dropContainer?(item: IDragDataItem<O>, monitor: DropTargetMonitor<IDragDataItem<O>, R>): O | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* 放置悬浮钩子
|
|
254
|
+
*
|
|
255
|
+
* @author zhanghanrui
|
|
256
|
+
* @date 2024-08-20 14:08:34
|
|
257
|
+
* @param {O} item
|
|
258
|
+
* @param {DropTargetMonitor<IDragDataItem<O>, R>} monitor
|
|
259
|
+
*/
|
|
260
|
+
hover?(item: IDragDataItem<O>, monitor: DropTargetMonitor<IDragDataItem<O>, R>): void;
|
|
261
|
+
/**
|
|
262
|
+
* 拖拽结束
|
|
263
|
+
*
|
|
264
|
+
* @author zhanghanrui
|
|
265
|
+
* @date 2024-08-20 14:08:02
|
|
266
|
+
* @param {O} item
|
|
267
|
+
* @param {DragSourceMonitor<IDragDataItem<O>, R>} monitor
|
|
268
|
+
*/
|
|
269
|
+
end?(item: IDragDataItem<O>, monitor: DragSourceMonitor<IDragDataItem<O>, R>): void;
|
|
270
|
+
/**
|
|
271
|
+
* 预览配置
|
|
272
|
+
*
|
|
273
|
+
* @author zhanghanrui
|
|
274
|
+
* @date 2024-08-20 14:08:41
|
|
275
|
+
* @type {DragPreviewOptions}
|
|
276
|
+
*/
|
|
277
|
+
previewOptions?: DragPreviewOptions;
|
|
278
|
+
/**
|
|
279
|
+
* 拖拽配置
|
|
280
|
+
*
|
|
281
|
+
* @author zhanghanrui
|
|
282
|
+
* @date 2024-08-20 14:08:46
|
|
283
|
+
* @type {DragSourceOptions}
|
|
284
|
+
*/
|
|
285
|
+
dragOptions?: DragSourceOptions;
|
|
286
|
+
/**
|
|
287
|
+
* 放置配置
|
|
288
|
+
*
|
|
289
|
+
* @author zhanghanrui
|
|
290
|
+
* @date 2024-08-20 14:08:58
|
|
291
|
+
* @type {DropTargetOptions}
|
|
292
|
+
*/
|
|
293
|
+
dropOptions?: DropTargetOptions;
|
|
294
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IVue3DndDraggableOptions, IRenderOptions, IDragDataItem, } from './i-vue3-dnd-draggable-options';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { methods_exports } from "./regularExpression/methods.mjs";
|
|
2
2
|
import { SYSTEM_VAR_PREFIX, functionMap, innerVarIds, operator2FuncMap } from "@gct-paas/core";
|
|
3
|
+
import { useMemoize } from "@vueuse/core";
|
|
3
4
|
import * as esprima from "esprima-next";
|
|
4
5
|
import estraverse from "estraverse";
|
|
5
|
-
import { useMemoize } from "@vueuse/core";
|
|
6
6
|
//#region src/utils/expression/index.ts
|
|
7
7
|
window._METHOD_DEBUG_ = methods_exports;
|
|
8
8
|
var identify = useMemoize(_identify);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
+
import BigNumberJS from "bignumber.js";
|
|
3
4
|
import { isEqual, isNull, isUndefined } from "lodash-es";
|
|
4
5
|
import utc from "dayjs/plugin/utc";
|
|
5
6
|
import timezone from "dayjs/plugin/timezone";
|
|
6
7
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
7
8
|
import toArray from "dayjs/plugin/toArray";
|
|
8
9
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
9
|
-
import BigNumberJS from "bignumber.js";
|
|
10
10
|
//#region src/utils/expression/regularExpression/methods.ts
|
|
11
11
|
var methods_exports = /* @__PURE__ */ __exportAll({
|
|
12
12
|
ABS: () => ABS,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
/**空值显示逻辑 */
|
|
3
|
+
export declare function emptyValueDisplay(widget: LowCodeWidget.FieldSchema, value: IObject): {
|
|
4
|
+
RenderEmptyValue: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
5
|
+
isEmpty: import('vue').ComputedRef<boolean | undefined>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed, defineComponent } from "vue";
|
|
2
|
+
//#region src/utils/field-empty-value.tsx
|
|
3
|
+
/**空值显示逻辑 */
|
|
4
|
+
function emptyValueDisplay(widget, value) {
|
|
5
|
+
/**部分字段排除空值显示 */
|
|
6
|
+
const exclude = [];
|
|
7
|
+
const fieldType = widget.props.fieldType;
|
|
8
|
+
const isEmpty = computed(() => {
|
|
9
|
+
return widget.props.readonly && fieldType && !exclude.includes(fieldType) && (value.value === void 0 || value.value === "" || value.value === null);
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
RenderEmptyValue: /* @__PURE__ */ defineComponent((_props, _slots) => () => _gct.store.getEmptyDisplay),
|
|
13
|
+
isEmpty
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { emptyValueDisplay };
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.mjs
CHANGED
package/es/utils/is.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
+
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
3
|
+
export declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
4
|
+
export declare function isObject(val: unknown): boolean;
|
|
5
|
+
export declare function isEmpty<T = unknown>(val: T): val is T;
|
|
6
|
+
export declare function isDate(val: unknown): val is Date;
|
|
7
|
+
export declare function isNull(val: unknown): val is null;
|
|
8
|
+
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
9
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
10
|
+
export declare function isNumber(val: unknown): val is number;
|
|
11
|
+
export declare function isPromise<T = IObject>(val: unknown): val is Promise<T>;
|
|
12
|
+
export declare function isString(val: unknown): val is string;
|
|
13
|
+
export declare function isFunction(val: unknown): val is Fn;
|
|
14
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
15
|
+
export declare function isRegExp(val: unknown): val is RegExp;
|
|
16
|
+
export declare function isArray(val: unknown): boolean;
|
|
17
|
+
export declare function isWindow(val: unknown): val is Window;
|
|
18
|
+
export declare function isElement(val: unknown): val is Element;
|
|
19
|
+
export declare function isMap(val: unknown): boolean;
|
|
20
|
+
export declare function isUrl(path: string): boolean;
|
|
21
|
+
export declare function isEmptyStr(str: unknown): boolean;
|
package/es/utils/is.mjs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/utils/is.ts
|
|
2
|
+
var toString = Object.prototype.toString;
|
|
3
|
+
function is(val, type) {
|
|
4
|
+
return toString.call(val) === `[object ${type}]`;
|
|
5
|
+
}
|
|
6
|
+
function isDef(val) {
|
|
7
|
+
return typeof val !== "undefined";
|
|
8
|
+
}
|
|
9
|
+
function isUnDef(val) {
|
|
10
|
+
return !isDef(val);
|
|
11
|
+
}
|
|
12
|
+
function isObject(val) {
|
|
13
|
+
return val !== null && is(val, "Object");
|
|
14
|
+
}
|
|
15
|
+
function isEmpty(val) {
|
|
16
|
+
if (isArray(val) || isString(val)) return val.length === 0;
|
|
17
|
+
if (val instanceof Map || val instanceof Set) return val.size === 0;
|
|
18
|
+
if (isObject(val)) return Object.keys(val).length === 0;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function isDate(val) {
|
|
22
|
+
return is(val, "Date");
|
|
23
|
+
}
|
|
24
|
+
function isNull(val) {
|
|
25
|
+
return val === null;
|
|
26
|
+
}
|
|
27
|
+
function isNullAndUnDef(val) {
|
|
28
|
+
return isUnDef(val) && isNull(val);
|
|
29
|
+
}
|
|
30
|
+
function isNullOrUnDef(val) {
|
|
31
|
+
return isUnDef(val) || isNull(val);
|
|
32
|
+
}
|
|
33
|
+
function isNumber(val) {
|
|
34
|
+
return is(val, "Number");
|
|
35
|
+
}
|
|
36
|
+
function isPromise(val) {
|
|
37
|
+
return is(val, "Promise") && isObject(val) && isFunction(val.then) && isFunction(val.then);
|
|
38
|
+
}
|
|
39
|
+
function isString(val) {
|
|
40
|
+
return is(val, "String");
|
|
41
|
+
}
|
|
42
|
+
function isFunction(val) {
|
|
43
|
+
return typeof val === "function";
|
|
44
|
+
}
|
|
45
|
+
function isBoolean(val) {
|
|
46
|
+
return is(val, "Boolean");
|
|
47
|
+
}
|
|
48
|
+
function isRegExp(val) {
|
|
49
|
+
return is(val, "RegExp");
|
|
50
|
+
}
|
|
51
|
+
function isArray(val) {
|
|
52
|
+
return !!val && Array.isArray(val);
|
|
53
|
+
}
|
|
54
|
+
function isWindow(val) {
|
|
55
|
+
return typeof window !== "undefined" && is(val, "Window");
|
|
56
|
+
}
|
|
57
|
+
function isElement(val) {
|
|
58
|
+
return isObject(val) && !!val.tagName;
|
|
59
|
+
}
|
|
60
|
+
function isMap(val) {
|
|
61
|
+
return is(val, "Map");
|
|
62
|
+
}
|
|
63
|
+
function isUrl(path) {
|
|
64
|
+
return /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(path);
|
|
65
|
+
}
|
|
66
|
+
function isEmptyStr(str) {
|
|
67
|
+
return str === void 0 || !str && str !== 0 && str !== "0" || !/[^\s]/.test(str + "");
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { is, isArray, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isString, isUnDef, isUrl, isWindow };
|
|
@@ -13,7 +13,7 @@ export declare function transformSourceData(data: RowData[], dict: DictMap): Row
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function transformData(row?: RowData, dict?: DictMap): RowData;
|
|
15
15
|
export declare function addDataByForm(formState: RowData, data: RowData, dict: DictMap): void;
|
|
16
|
-
export declare function setDataByForm(formState:
|
|
16
|
+
export declare function setDataByForm(formState: IObject, data: RowData, dict: DictMap): void;
|
|
17
17
|
/**
|
|
18
18
|
* 表单 select 数据处理
|
|
19
19
|
* @param data 数据信息
|
|
@@ -15,3 +15,9 @@ export declare const useQueryfilter: (datafilter: IObject[] | IObject) => {
|
|
|
15
15
|
query: IObject;
|
|
16
16
|
getExp: (...arg: string[]) => string;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* 生成排序查询条件
|
|
20
|
+
* @param param0
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const getQuerySort: ({ collation, collationSort, collationField, }: IObject) => any;
|
|
@@ -66,5 +66,22 @@ var useQueryfilter = (datafilter) => {
|
|
|
66
66
|
getExp
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* 生成排序查询条件
|
|
71
|
+
* @param param0
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
var getQuerySort = ({ collation, collationSort, collationField }) => {
|
|
75
|
+
if (collation) return collation.filter((i) => i.collationField).map((i) => {
|
|
76
|
+
return {
|
|
77
|
+
sortField: i.collationField,
|
|
78
|
+
sortType: i.collationSort
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
else return collationSort ? [{
|
|
82
|
+
sortField: collationField,
|
|
83
|
+
sortType: collationSort
|
|
84
|
+
}] : [];
|
|
85
|
+
};
|
|
69
86
|
//#endregion
|
|
70
|
-
export { getIExp, getIKeywordFieldKeys, getQueryDateByKeyWord, useQueryfilter };
|
|
87
|
+
export { getIExp, getIKeywordFieldKeys, getQueryDateByKeyWord, getQuerySort, useQueryfilter };
|